Closed
Bug 1664
Opened 26 years ago
Closed 26 years ago
NSGetSharedLibrary leaks the result from PR_GetLibraryPathNSGetSharedLibrary(Str255 inLibName, CFragConnectionID* outID, Ptr* outMainAddr){char*curLibPath;char*freeCurLibPath;OSErrtempErr;Booleanrecursive;FSSpeccurFolder;GetShared
Categories
(NSPR :: NSPR, defect, P2)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: beard, Assigned: wtc)
Details
PR_GetLibraryPath returns a strduped copy of a string. NSGetSharedLibrary turns
around and strdups it again, leaking the value returned from PR_GetLibraryPath.
Here's the code fragment that does this (from macdll.c, line 113):
freeCurLibPath = curLibPath = strdup(PR_GetLibraryPath());
Here's the line from prlink.c (line 350) that returns a newly duplicated string:
copy = strdup(_pr_currentLibPath);
Clearly, everytime this gets called a copy of this path string is leaked.
Assignee | ||
Updated•26 years ago
|
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Summary: NSGetSharedLibrary leaks the result from PR_GetLibraryPath
NSGetSharedLibrary(Str255 inLibName, CFragConnectionID* outID, Ptr* outMainAddr)
{
char* curLibPath;
char* freeCurLibPath;
OSErr tempErr;
Boolean recursive;
FSSpec curFolder;
GetShared → NSGetSharedLibrary leaks the result from PR_GetLibraryPathNSGetSharedLibrary(Str255 inLibName, CFragConnectionID* outID, Ptr* outMainAddr){char*curLibPath;char*freeCurLibPath;OSErrtempErr;Booleanrecursive;FSSpeccurFolder;GetShared
Assignee | ||
Comment 1•26 years ago
|
||
Fixed. The strdup call in NSGetSharedLibrary is unnecessary
and should be removed.
/cvsroot/mozilla/nsprpub/pr/src/md/mac/macdll.c, revision 3.2.
Updated•26 years ago
|
QA Contact: 3819
Comment 2•26 years ago
|
||
will mark verified assuming beard agrees with fix, setting me as QA contact
Updated•26 years ago
|
Status: RESOLVED → VERIFIED
Comment 3•26 years ago
|
||
marking verified
Reporter | ||
Comment 4•26 years ago
|
||
Fix looks right. Approved.
Comment 5•26 years ago
|
||
NSPR now has its own Bugzilla product. Moving this bug to the NSPR product.
You need to log in
before you can comment on or make changes to this bug.
Description
•