Closed
Bug 165863
Opened 23 years ago
Closed 23 years ago
Memory leaks on error paths in nssTrustDomain_FindTrustForCertificate
Categories
(NSS :: Libraries, defect, P4)
Tracking
(Not tracked)
RESOLVED
FIXED
3.6
People
(Reporter: wtc, Assigned: bugz)
Details
Attachments
(1 file)
888 bytes,
patch
|
wtc
:
review+
|
Details | Diff | Splinter Review |
In trustdomain.c, function nssTrustDomain_FindTrustForCertificate,
'token' is leaked on some error paths.
Here is the code fragment. 'token' is not destroyed if either of
the 'goto loser' statements is taken. Also, it seems that 'to'
is not destroyed.
token = nssSlot_GetToken(*slotp);
if (token) {
to = nssToken_FindTrustForCertificate(token, NULL,
&c->encoding,
&c->issuer,
&c->serial,
nssTokenSearchType_TokenOnly);
if (to) {
if (!pkio) {
pkio = nssPKIObject_Create(NULL, to, td, NULL);
if (!pkio) {
goto loser;
}
} else {
status = nssPKIObject_AddInstance(pkio, to);
if (status != PR_SUCCESS) {
goto loser;
}
}
}
nssToken_Destroy(token);
}
Assignee | ||
Comment 1•23 years ago
|
||
"to" is freed, I moved it up to make it more clear in the error paths.
In the success path, "to" becomes part of the PKIObject. It will be freed with
the PKIObject.
Assignee | ||
Comment 2•23 years ago
|
||
fixed on tip (3.6)
Status: NEW → RESOLVED
Closed: 23 years ago
Priority: -- → P4
Resolution: --- → FIXED
Target Milestone: --- → 3.6
Reporter | ||
Comment 3•23 years ago
|
||
Comment on attachment 97637 [details] [diff] [review]
free the token in error paths
r=wtc.
Attachment #97637 -
Flags: review+
You need to log in
before you can comment on or make changes to this bug.
Description
•