111371 r/sr=bienvenu fix char* leaks when reading filenames from disk.

This commit is contained in:
naving%netscape.com 2001-11-25 03:02:24 +00:00
Родитель ad706350b0
Коммит 7faf639ae4
1 изменённых файлов: 9 добавлений и 2 удалений

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

@ -234,7 +234,10 @@ nsMsgLocalMailFolder::CreateSubFolders(nsFileSpec &path)
for (nsDirectoryIterator dir(path, PR_FALSE); dir.Exists(); dir++) {
nsFileSpec currentFolderPath = dir.Spec();
nsMsgGetNativePathString(currentFolderPath.GetLeafName(),currentFolderNameStr);
char *leafName = currentFolderPath.GetLeafName();
nsMsgGetNativePathString(leafName, currentFolderNameStr);
PR_FREEIF(leafName);
if (nsShouldIgnoreFile(currentFolderNameStr))
continue;
@ -771,7 +774,11 @@ nsMsgLocalMailFolder::CheckIfFolderExists(const PRUnichar *folderName, nsFileSpe
for (nsDirectoryIterator dir(path, PR_FALSE); dir.Exists(); dir++)
{
nsFileSpec currentFolderPath = dir.Spec();
nsMsgGetNativePathString(currentFolderPath.GetLeafName(),leafName);
char *leaf = currentFolderPath.GetLeafName();
nsMsgGetNativePathString(leaf,leafName);
PR_FREEIF(leaf);
if (!leafName.IsEmpty() &&
Compare(nsDependentString(folderName), leafName,
nsCaseInsensitiveStringComparator()) == 0)