Closed
Bug 135058
Opened 23 years ago
Closed 23 years ago
Leaked slot references in lib/pk11wrap/pk11cert.c
Categories
(NSS :: Libraries, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
3.5
People
(Reporter: wtc, Assigned: bugz)
References
Details
(Whiteboard: [adt2 RTM])
Attachments
(1 file, 1 obsolete file)
|
1004 bytes,
patch
|
bugz
:
review+
|
Details | Diff | Splinter Review |
In PK11_FindCertFromNickname(), there are two places
where we return NULL without calling PK11_FreeSlot().
1.
if (!PK11_IsPresent(slot)) {
return NULL;
}
2.
/* find matching certs on the token */
certList = nssList_Create(NULL, PR_FALSE);
if (!certList) return NULL;
It seems that the slot reference would be leaked.
| Reporter | ||
Comment 1•23 years ago
|
||
PK11_FindCertsFromNickname() in the same file has the same
problem. It does not free the slot reference here:
1554 if (!nameList) return NULL;
| Reporter | ||
Comment 2•23 years ago
|
||
PK11_SaveSMimeProfile() calls PK11_GetInternalKeySlot() but
does not free the slot reference.
There is a comment that says it should be done :-)
3988 if (slot == NULL) {
3989 slot = PK11_GetInternalKeySlot();
3990 /* we need to free the key slot in the end!!! */
3991 }
Summary: Leaked slot reference in PK11_FindCertFromNickname() → Leaked slot references in lib/pk11wrap/pk11cert.c
| Reporter | ||
Comment 3•23 years ago
|
||
I decided to use "goto loser" in PK11_FindCertFromNickname
and PK11_FindCertsFromNickname because they also need to
free 'nickCopy' before returning.
| Reporter | ||
Comment 4•23 years ago
|
||
Changed the QA contact to Bishakha.
QA Contact: sonja.mirtitsch → bishakhabanerjee
| Reporter | ||
Comment 5•23 years ago
|
||
I verified that in the current revision (1.80) of pk11cert.c
all the slot reference leaks I reported have been fixed.
The only thing left to do is to free the string 'nickCopy'
on error returns in PK11_FindCertsFromNickname, which is
what this patch does.
Please review. Thanks.
Attachment #78484 -
Attachment is obsolete: true
| Reporter | ||
Updated•23 years ago
|
Priority: -- → P1
Target Milestone: --- → 3.5
| Assignee | ||
Updated•23 years ago
|
Attachment #82880 -
Flags: review+
| Reporter | ||
Comment 6•23 years ago
|
||
Patch checked into the tip of NSS.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 7•23 years ago
|
||
adt1.0.1+ (on ADT's behalf) for checkin to the 1.0 branch. Pls check this in
asap. thanks!
| Reporter | ||
Updated•23 years ago
|
Keywords: adt1.0.1+ → fixed1.0.1
You need to log in
before you can comment on or make changes to this bug.
Description
•