Fix for calls to nsFileSpec::GetLeafName(). It allocates memory with strdup(), so use free() and not delete[].

This commit is contained in:
bruce%cybersight.com 1999-04-25 13:27:36 +00:00
Родитель a847baa45c
Коммит ff745bb2cd
7 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -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;