MacFileHelpers::EncodeMacPath() returns the result of an nsEscape() call, so all callers must nsCRT::free() the result instead of using delete[].

This commit is contained in:
bruce%cybersight.com 1999-09-04 17:09:06 +00:00
Родитель 87b10d9485
Коммит 36d8b82698
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -1210,7 +1210,7 @@ void nsFilePath::operator = (const nsFileSpec& inSpec)
char * path = MacFileHelpers::PathNameFromFSSpec(inSpec, true);
path = MacFileHelpers::EncodeMacPath(path, true, false);
mPath = path;
delete [] path;
nsCRT::free(path);
mFileSpec = inSpec;
} // nsFilePath::operator =
@ -1221,7 +1221,7 @@ void nsFilePath::operator = (const nsFileURL& inOther)
char * path = MacFileHelpers::PathNameFromFSSpec(inOther.mFileSpec, true);
path = MacFileHelpers::EncodeMacPath(path, true, false);
mPath = path;
delete [] path;
nsCRT::free(path);
mFileSpec = inOther.GetFileSpec();
}
@ -1296,7 +1296,7 @@ void nsFileURL::operator = (const nsFileSpec& inOther)
char* encodedPath = MacFileHelpers::EncodeMacPath(path, true, true);
nsSimpleCharString encodedURL(kFileURLPrefix);
encodedURL += encodedPath;
delete [] encodedPath;
nsCRT::free(encodedPath);
mURL = encodedURL;
if (encodedURL[encodedURL.Length() - 1] != '/' && inOther.IsDirectory())
mURL += "/";