Closed
Bug 339919
Opened 19 years ago
Closed 19 years ago
Coverity 905, leak in CERT_GetCertNicknames
Categories
(NSS :: Libraries, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
3.11.2
People
(Reporter: nelson, Assigned: nelson)
Details
(Keywords: coverity, memory-leak, Whiteboard: [CID 465 905])
Attachments
(1 file)
|
1.08 KB,
patch
|
alvolkov.bgs
:
review+
|
Details | Diff | Splinter Review |
Coverity CID 905
The leak is actually in static function CollectNicknames, called from CERT_GetCertNicknames in file nss/lib/certhigh/certhigh.c .
If variable "saveit" is true (non-zero) and the cert's nickname is not
found in the linked list of nickname "stringnodes", and our attempt
to allocate a new stringNode from the names->arena fails, then we
return PR_FAILURE without freeing nickname, leaking nickname.
Solution is to unconditionally PORT_Free(nickname) in that error path.
| Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → 3.11.2
| Assignee | ||
Comment 1•19 years ago
|
||
Patch Also eliminates a "use before null check" error.
Attachment #224828 -
Flags: review?
| Assignee | ||
Updated•19 years ago
|
Attachment #224828 -
Flags: review? → review?(alexei.volkov.bugs)
Comment 2•19 years ago
|
||
Comment on attachment 224828 [details] [diff] [review]
patch v1
r=alexei
Attachment #224828 -
Flags: review?(alexei.volkov.bugs) → review+
| Assignee | ||
Comment 3•19 years ago
|
||
Fix leaks in CERT_DistNamesFromNicknames (bug 339916) and in
CERT_GetCertNicknames (bug 339919). Coverity bugs. r=alexei.volkov
Checking in certhigh.c; new revision: 1.34.2.3; previous revision: 1.34.2.2
Checking in certhigh.c; new revision: 1.37; previous revision: 1.36
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•