mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Fix some leaks, and other problems found using BoundsChecker r=bryner@uiuc.edu
This commit is contained in:
parent
1823171144
commit
ea7c30bd13
@ -230,16 +230,25 @@ nsPluginTag::~nsPluginTag()
|
||||
}
|
||||
|
||||
if (nsnull != mMimeTypeArray) {
|
||||
for (int i = 0; i < mVariants; i++)
|
||||
delete[] mMimeTypeArray[i];
|
||||
|
||||
delete[] (mMimeTypeArray);
|
||||
mMimeTypeArray = nsnull;
|
||||
}
|
||||
|
||||
if (nsnull != mMimeDescriptionArray) {
|
||||
for (int i = 0; i < mVariants; i++)
|
||||
delete[] mMimeDescriptionArray[i];
|
||||
|
||||
delete[] (mMimeDescriptionArray);
|
||||
mMimeDescriptionArray = nsnull;
|
||||
}
|
||||
|
||||
if (nsnull != mExtensionsArray) {
|
||||
for (int i = 0; i < mVariants; i++)
|
||||
delete[] mExtensionsArray[i];
|
||||
|
||||
delete[] (mExtensionsArray);
|
||||
mExtensionsArray = nsnull;
|
||||
}
|
||||
|
@ -230,16 +230,25 @@ nsPluginTag::~nsPluginTag()
|
||||
}
|
||||
|
||||
if (nsnull != mMimeTypeArray) {
|
||||
for (int i = 0; i < mVariants; i++)
|
||||
delete[] mMimeTypeArray[i];
|
||||
|
||||
delete[] (mMimeTypeArray);
|
||||
mMimeTypeArray = nsnull;
|
||||
}
|
||||
|
||||
if (nsnull != mMimeDescriptionArray) {
|
||||
for (int i = 0; i < mVariants; i++)
|
||||
delete[] mMimeDescriptionArray[i];
|
||||
|
||||
delete[] (mMimeDescriptionArray);
|
||||
mMimeDescriptionArray = nsnull;
|
||||
}
|
||||
|
||||
if (nsnull != mExtensionsArray) {
|
||||
for (int i = 0; i < mVariants; i++)
|
||||
delete[] mExtensionsArray[i];
|
||||
|
||||
delete[] (mExtensionsArray);
|
||||
mExtensionsArray = nsnull;
|
||||
}
|
||||
|
@ -401,8 +401,8 @@ inline PRInt32 FindChar1(const char* aDest,PRUint32 aDestLength,PRInt32 anOffset
|
||||
|
||||
PRInt32 theMax = end-left;
|
||||
if(0<theMax) {
|
||||
char theChar=(char)aChar;
|
||||
const char* result=(const char*)memchr(left, theChar, theMax);
|
||||
unsigned char theChar = (unsigned char) aChar;
|
||||
const char* result=(const char*)memchr(left, (int)theChar, theMax);
|
||||
if(result) {
|
||||
return result-aDest;
|
||||
}
|
||||
|
@ -104,18 +104,22 @@ public:
|
||||
@param aCount the number of bytes to copy
|
||||
*/
|
||||
static void memcpy(void* aDest, const void* aSrc, PRUint32 aCount) {
|
||||
NS_ASSERTION((aDest != NULL && aSrc != NULL) || (aCount == 0), "Invalid NULL argument");
|
||||
::memcpy(aDest, aSrc, (size_t)aCount);
|
||||
}
|
||||
|
||||
static void memmove(void* aDest, const void* aSrc, PRUint32 aCount) {
|
||||
NS_ASSERTION((aDest != NULL && aSrc != NULL) || (aCount == 0), "Invalid NULL argument");
|
||||
::memmove(aDest, aSrc, (size_t)aCount);
|
||||
}
|
||||
|
||||
static void memset(void* aDest, PRUint8 aByte, PRUint32 aCount) {
|
||||
NS_ASSERTION((aDest != NULL) || (aCount == 0), "Invalid NULL argument");
|
||||
::memset(aDest, aByte, aCount);
|
||||
}
|
||||
|
||||
static void zero(void* aDest, PRUint32 aCount) {
|
||||
NS_ASSERTION((aDest != NULL) || (aCount == 0), "Invalid NULL argument");
|
||||
::memset(aDest, 0, (size_t)aCount);
|
||||
}
|
||||
|
||||
|
@ -286,7 +286,9 @@ nsSplashScreenWin::Show() {
|
||||
|
||||
// Spawn new thread to display real splash screen.
|
||||
DWORD threadID = 0;
|
||||
CreateThread( 0, 0, (LPTHREAD_START_ROUTINE)ThreadProc, this, 0, &threadID );
|
||||
HANDLE handle = CreateThread( 0, 0, (LPTHREAD_START_ROUTINE)ThreadProc, this, 0, &threadID );
|
||||
CloseHandle(handle);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user