зеркало из https://github.com/mozilla/gecko-dev.git
Fix for calls to nsFileSpec::GetLeafName(). It allocates memory with strdup(), so use free() and not delete[].
This commit is contained in:
Родитель
a847baa45c
Коммит
ff745bb2cd
|
@ -319,9 +319,9 @@ NS_IMETHODIMP nsImapMailFolder::GetSubFolders(nsIEnumerator* *result)
|
|||
PL_strcat(newLeafName, kDirExt);
|
||||
path->SetLeafName(newLeafName);
|
||||
if(folderName)
|
||||
delete[] folderName;
|
||||
nsCRT::free(folderName);
|
||||
if(newLeafName)
|
||||
delete[] newLeafName;
|
||||
nsCRT::free(newLeafName);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -293,9 +293,9 @@ nsMsgLocalMailFolder::GetSubFolders(nsIEnumerator* *result)
|
|||
PL_strcat(newLeafName, kDirExt);
|
||||
path->SetLeafName(newLeafName);
|
||||
if(folderName)
|
||||
delete[] folderName;
|
||||
nsCRT::free(folderName);
|
||||
if(newLeafName)
|
||||
delete[] newLeafName;
|
||||
nsCRT::free(newLeafName);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -798,7 +798,7 @@ FileSystemDataSource::isVisible(const nsNativeFileSpec& file)
|
|||
{
|
||||
isVisible = PR_FALSE;
|
||||
}
|
||||
delete []basename;
|
||||
nsCRT::free(basename);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -863,7 +863,7 @@ FileSystemDataSource::GetName(nsIRDFResource *source, nsIRDFLiteral **aResult)
|
|||
nsIRDFLiteral *literal;
|
||||
gRDFService->GetLiteral(name.GetUnicode(), &literal);
|
||||
*aResult = literal;
|
||||
delete []basename;
|
||||
nsCRT::free(basename);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ nsresult nsPrefsCore::InitializePrefsManager()
|
|||
oldPrefs.Copy(newParent);
|
||||
const char* oldName = oldPrefs.GetLeafName();
|
||||
newPrefs = newParent + oldName;
|
||||
delete [] oldName;
|
||||
PL_strfree(oldName);
|
||||
newPrefs.Rename("prefs.js");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ void ReplaceScheduledFiles(void)
|
|||
{
|
||||
char* leafName = targetFile.GetLeafName();
|
||||
replaceFile.Rename(leafName);
|
||||
delete [] leafName;
|
||||
nsCRT::free(leafName);
|
||||
|
||||
NR_RegDeleteEntry( reg, key, tmpfile );
|
||||
}
|
||||
|
|
|
@ -192,7 +192,7 @@ PRInt32 nsInstallFile::CompleteFileMove()
|
|||
|
||||
char* leafName = mFinalFile->GetLeafName();
|
||||
mExtracedFile->Rename(leafName);
|
||||
delete [] leafName;
|
||||
nsCRT::free(leafName);
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -209,7 +209,7 @@ PRInt32 nsInstallFile::CompleteFileMove()
|
|||
|
||||
char* leafName = mFinalFile->GetLeafName();
|
||||
mExtracedFile->Rename(leafName);
|
||||
delete [] leafName;
|
||||
nsCRT::free(leafName);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -320,7 +320,7 @@ nsInstallPatch::NativeReplace(const nsFileSpec& oldfile, nsFileSpec& newFile)
|
|||
|
||||
char* leafName = newFile.GetLeafName();
|
||||
newFile.Rename(leafName);
|
||||
delete [] leafName;
|
||||
nsCRT::free(leafName);
|
||||
}
|
||||
|
||||
return nsInstall::SUCCESS;
|
||||
|
|
Загрузка…
Ссылка в новой задаче