зеркало из https://github.com/mozilla/pjs.git
Fixes a memory leak.
This commit is contained in:
Родитель
5cd2651bdf
Коммит
c5e288fe92
|
@ -151,18 +151,23 @@ nsresult
|
||||||
nsMsgLocalMailFolder::CreateSubFolders(nsFileSpec &path)
|
nsMsgLocalMailFolder::CreateSubFolders(nsFileSpec &path)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
nsAutoString currentFolderName;
|
nsAutoString currentFolderNameStr;
|
||||||
nsIMsgFolder *child;
|
nsIMsgFolder *child;
|
||||||
|
char *folderName;
|
||||||
for (nsDirectoryIterator dir(path); dir.Exists(); dir++) {
|
for (nsDirectoryIterator dir(path); dir.Exists(); dir++) {
|
||||||
nsFileSpec currentFolderPath = (nsFileSpec&)dir;
|
nsFileSpec currentFolderPath = (nsFileSpec&)dir;
|
||||||
|
|
||||||
currentFolderName = currentFolderPath.GetLeafName();
|
folderName = currentFolderPath.GetLeafName();
|
||||||
if (nsShouldIgnoreFile(currentFolderName))
|
currentFolderNameStr = folderName;
|
||||||
|
if (nsShouldIgnoreFile(currentFolderNameStr))
|
||||||
|
{
|
||||||
|
PL_strfree(folderName);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
AddSubfolder(currentFolderName, &child);
|
AddSubfolder(currentFolderNameStr, &child);
|
||||||
NS_IF_RELEASE(child);
|
NS_IF_RELEASE(child);
|
||||||
|
PL_strfree(folderName);
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче