(*mySound)->mBufferSize = 4098; (*mySound)->mBuffer = (char *) PR_Malloc( (*mySound)->mBufferSize ); if ( (*mySound)->mBuffer == (char *) NULL ) return NS_ERROR_OUT_OF_MEMORY; (*mySound)->mPlayBuf = (char *) NULL;
nsresult NS_NewSound(nsISound** aSound){  NS_PRECONDITION(aSound != nsnull, "null ptr");  if (! aSound)    return NS_ERROR_NULL_POINTER;  nsSound** mySound;  *aSound = new nsSound();  if (! *aSound)    return NS_ERROR_OUT_OF_MEMORY;  mySound = (nsSound **) aSound;  (*mySound)->mBufferSize = 4098;  (*mySound)->mBuffer = (char *) PR_Malloc( (*mySound)->mBufferSize );  if ( (*mySound)->mBuffer == (char *) NULL )        return NS_ERROR_OUT_OF_MEMORY;  (*mySound)->mPlayBuf = (char *) NULL;    NS_ADDREF(*aSound);  return NS_OK;}