Memory leak.

delete[] memory returned by nsString::ToNewCString.
This commit is contained in:
ramiro%netscape.com 1999-03-08 11:38:59 +00:00
parent aea0f271b0
commit 61be65aad6

View File

@ -129,7 +129,14 @@ NS_IMETHODIMP nsXULCommand::DoCommand()
mWebShell->GetName( &name);
nsAutoString str(name);
if (DEBUG_MENUSDEL) printf("DoCommand - mWebShell is [%s] 0x%x\n", str.ToNewCString(), mWebShell);
if (DEBUG_MENUSDEL)
{
char * cstr = str.ToNewCString();
printf("DoCommand - mWebShell is [%s] 0x%x\n",cstr, mWebShell);
if (cstr) delete [] cstr;
}
return ExecuteJavaScriptString(mWebShell, mCommandStr);
}