mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
purify fixes from bruce@cybersight.com
This commit is contained in:
parent
cc9159b956
commit
5cf6c68027
@ -123,7 +123,7 @@ static void DebugDump(const char* str1,const nsString& str2,PRInt32 tabs) {
|
||||
cout << " "; //add some tabbing to debug output...
|
||||
char* cp = str2.ToNewCString();
|
||||
cout << str1 << cp << ">" << endl;
|
||||
delete cp;
|
||||
delete[] cp;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1405,7 +1405,7 @@ PRInt32 CEntityToken::TranslateToUnicodeStr(nsString& aString) {
|
||||
void CEntityToken::DebugDumpSource(ostream& out) {
|
||||
char* cp=mTextValue.ToNewCString();
|
||||
out << "&" << *cp;
|
||||
delete cp;
|
||||
delete[] cp;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -258,7 +258,7 @@ PRBool nsScanner::Append(const char* aBuffer, PRUint32 aLen){
|
||||
PRUnichar *unichars = new PRUnichar [ unicharLength ];
|
||||
nsresult res = mUnicodeDecoder->Convert(unichars, 0, &unicharLength,aBuffer, 0, &srcLength );
|
||||
mBuffer.Append(unichars, unicharLength);
|
||||
delete unichars;
|
||||
delete[] unichars;
|
||||
mTotalRead += unicharLength;
|
||||
}
|
||||
else {
|
||||
|
@ -123,7 +123,7 @@ static void DebugDump(const char* str1,const nsString& str2,PRInt32 tabs) {
|
||||
cout << " "; //add some tabbing to debug output...
|
||||
char* cp = str2.ToNewCString();
|
||||
cout << str1 << cp << ">" << endl;
|
||||
delete cp;
|
||||
delete[] cp;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1405,7 +1405,7 @@ PRInt32 CEntityToken::TranslateToUnicodeStr(nsString& aString) {
|
||||
void CEntityToken::DebugDumpSource(ostream& out) {
|
||||
char* cp=mTextValue.ToNewCString();
|
||||
out << "&" << *cp;
|
||||
delete cp;
|
||||
delete[] cp;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -258,7 +258,7 @@ PRBool nsScanner::Append(const char* aBuffer, PRUint32 aLen){
|
||||
PRUnichar *unichars = new PRUnichar [ unicharLength ];
|
||||
nsresult res = mUnicodeDecoder->Convert(unichars, 0, &unicharLength,aBuffer, 0, &srcLength );
|
||||
mBuffer.Append(unichars, unicharLength);
|
||||
delete unichars;
|
||||
delete[] unichars;
|
||||
mTotalRead += unicharLength;
|
||||
}
|
||||
else {
|
||||
|
@ -811,7 +811,7 @@ nsBrowserWindow::DoFileOpen()
|
||||
|
||||
// Ask the Web widget to load the file URL
|
||||
mWebShell->LoadURL(nsString(lpszFileURL));
|
||||
delete lpszFileURL;
|
||||
delete[] lpszFileURL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2429,7 +2429,7 @@ nsBrowserWindow::OnProgress(nsIURL* aURL,
|
||||
PRUnichar* str;
|
||||
aURL->ToString(&str);
|
||||
url = str;
|
||||
delete str;
|
||||
delete[] str;
|
||||
}
|
||||
url.Append(": progress ");
|
||||
url.Append(aProgress, 10);
|
||||
@ -2461,7 +2461,7 @@ nsBrowserWindow::OnStartBinding(nsIURL* aURL, const char *aContentType)
|
||||
PRUnichar* str;
|
||||
aURL->ToString(&str);
|
||||
url = str;
|
||||
delete str;
|
||||
delete[] str;
|
||||
}
|
||||
url.Append(": start");
|
||||
SetStatus(url);
|
||||
@ -2480,7 +2480,7 @@ nsBrowserWindow::OnStopBinding(nsIURL* aURL,
|
||||
PRUnichar* str;
|
||||
aURL->ToString(&str);
|
||||
url = str;
|
||||
delete str;
|
||||
delete[] str;
|
||||
}
|
||||
url.Append(": stop");
|
||||
SetStatus(url);
|
||||
@ -2496,7 +2496,7 @@ nsBrowserWindow::Alert(const nsString &aText)
|
||||
|
||||
str = aText.ToNewCString();
|
||||
printf("Browser Window Alert: %c%s\n", '\007', str);
|
||||
PR_Free(str);
|
||||
delete[] str;
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
@ -2507,7 +2507,7 @@ nsBrowserWindow::Confirm(const nsString &aText)
|
||||
|
||||
str = aText.ToNewCString();
|
||||
printf("%cBrowser Window Confirm: %s (y/n)? ", '\007', str);
|
||||
PR_Free(str);
|
||||
delete[] str;
|
||||
char c;
|
||||
for (;;) {
|
||||
c = getchar();
|
||||
@ -2531,7 +2531,7 @@ nsBrowserWindow::Prompt(const nsString &aText,
|
||||
|
||||
str = aText.ToNewCString();
|
||||
printf("Browser Window: %s\n", str);
|
||||
PR_Free(str);
|
||||
delete[] str;
|
||||
|
||||
str = aDefault.ToNewCString();
|
||||
printf("%cPrompt (default=%s): ", '\007', str);
|
||||
@ -2541,7 +2541,7 @@ nsBrowserWindow::Prompt(const nsString &aText,
|
||||
} else {
|
||||
aResult = aDefault;
|
||||
}
|
||||
PR_Free(str);
|
||||
delete[] str;
|
||||
|
||||
return (aResult.Length() > 0);
|
||||
}
|
||||
@ -2557,7 +2557,7 @@ nsBrowserWindow::PromptUserAndPassword(const nsString &aText,
|
||||
|
||||
str = aText.ToNewCString();
|
||||
printf("Browser Window: %s\n", str);
|
||||
PR_Free(str);
|
||||
delete[] str;
|
||||
|
||||
str = aUser.ToNewCString();
|
||||
printf("%cUser (default=%s): ", '\007', str);
|
||||
@ -2565,7 +2565,7 @@ nsBrowserWindow::PromptUserAndPassword(const nsString &aText,
|
||||
if (strlen(buf)) {
|
||||
aUser = buf;
|
||||
}
|
||||
PR_Free(str);
|
||||
delete[] str;
|
||||
|
||||
str = aPassword.ToNewCString();
|
||||
printf("%cPassword (default=%s): ", '\007', str);
|
||||
@ -2573,7 +2573,7 @@ nsBrowserWindow::PromptUserAndPassword(const nsString &aText,
|
||||
if (strlen(buf)) {
|
||||
aPassword = buf;
|
||||
}
|
||||
PR_Free(str);
|
||||
delete[] str;
|
||||
|
||||
return (aUser.Length() > 0);
|
||||
}
|
||||
@ -2588,7 +2588,7 @@ nsBrowserWindow::PromptPassword(const nsString &aText,
|
||||
|
||||
str = aText.ToNewCString();
|
||||
printf("Browser Window: %s\n", str);
|
||||
PR_Free(str);
|
||||
delete[] str;
|
||||
|
||||
printf("%cPassword: ", '\007');
|
||||
gets(buf);
|
||||
|
Loading…
Reference in New Issue
Block a user