mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
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:
parent
87b10d9485
commit
36d8b82698
@ -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 += "/";
|
||||
|
Loading…
Reference in New Issue
Block a user