Closed
Bug 339916
Opened 18 years ago
Closed 18 years ago
Coverity 464, leak after OOM in CERT_DistNamesFromNicknames
Categories
(NSS :: Libraries, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
3.11.2
People
(Reporter: nelson, Assigned: nelson)
Details
(Keywords: coverity, memory-leak)
Attachments
(1 file)
1.25 KB,
patch
|
alvolkov.bgs
:
review+
|
Details | Diff | Splinter Review |
In CERT_DistNamesFromNicknames (file nss/lib/certhigh/certhigh.c ) after allocating "dnames", if the allocation of "names" gets NULL, we leak dnames. One question to investigate while working on this: Is this function dead code? If so, the solution is to remove it.
Assignee | ||
Updated•18 years ago
|
Priority: -- → P2
Target Milestone: --- → 3.11.2
Assignee | ||
Comment 1•18 years ago
|
||
This problem is much worse than Coverity indicated. All the things allocated in CERT_DistNamesFromNicknames are supposed to be part of the CERTDistNames object it returns, and are supposed to be allocated from its one arenapool. When this object is destroyed, function CERT_FreeDistNames merely frees the arena. All the parts of the object are supposed to go away when that happens, but the parts not allocated from the arena will be leaked at that time. So, the fix is not to free dnames at loser, but rather to ensure that dnames and names are both allocated from the arenapool, and that it is destroyed.
Assignee | ||
Comment 2•18 years ago
|
||
Alexei, please review this patch very thoroughly, making sure that no users of CERTDistNames objects depend on dnames or names being allocated directly from the heap, rather than from an arenapool.
Assignee: alexei.volkov.bugs → nelson
Status: NEW → ASSIGNED
Attachment #224833 -
Flags: review?(alexei.volkov.bugs)
Comment 3•18 years ago
|
||
Comment on attachment 224833 [details] [diff] [review] patch v1 r=alexei
Attachment #224833 -
Flags: review?(alexei.volkov.bugs) → review+
Assignee | ||
Comment 4•18 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: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•