Closed
Bug 366557
Opened 19 years ago
Closed 19 years ago
Small memory leaks in selfserv.
Categories
(NSS :: Tools, defect, P4)
Tracking
(Not tracked)
RESOLVED
FIXED
3.11.7
People
(Reporter: slavomir.katuscak+mozilla, Assigned: alvolkov.bgs)
Details
(Keywords: memory-leak)
Attachments
(2 files, 2 obsolete files)
|
4.08 KB,
patch
|
neil.williams
:
review+
nelson
:
review+
|
Details | Diff | Splinter Review |
|
1.71 KB,
patch
|
nelson
:
review+
neil.williams
:
superreview+
|
Details | Diff | Splinter Review |
Selfserv uses strdup() when parsing command line options and this memory is never released. It's just small amount of memory, but these leaks shows up in every memory leak test.
| Reporter | ||
Updated•19 years ago
|
Priority: -- → P4
| Assignee | ||
Comment 1•19 years ago
|
||
Assignee: nobody → alexei.volkov.bugs
Status: NEW → ASSIGNED
Attachment #257445 -
Flags: review?(neil.williams)
Updated•19 years ago
|
Target Milestone: --- → 3.11.7
| Assignee | ||
Comment 2•19 years ago
|
||
Attachment #257445 -
Attachment is obsolete: true
Attachment #257447 -
Flags: review?(neil.williams)
Attachment #257445 -
Flags: review?(neil.williams)
Updated•19 years ago
|
Attachment #257447 -
Flags: review+
| Assignee | ||
Comment 3•19 years ago
|
||
committed into trunk:
/cvsroot/mozilla/security/nss/cmd/selfserv/selfserv.c,v <-- selfserv.c
new revision: 1.76; previous revision: 1.75
Updated•19 years ago
|
Attachment #257447 -
Flags: review?(neil.williams) → review+
| Reporter | ||
Comment 4•19 years ago
|
||
It's crashing, here is the stack:
(gdb) bt
#0 0x00000032561691d6 in free () from /lib64/tls/libc.so.6
#1 0x0000002a95bc9503 in PR_Free (ptr=0x413275) at ../../../../pr/src/malloc/prmem.c:490
#2 0x0000002a9584f720 in PORT_Free (ptr=0x413275) at secport.c:152
#3 0x0000000000408f5e in main (argc=15, argv=0x7fbfffeeb8) at selfserv.c:2056
/share/builds/mccrel3/security/securitytip/builds/20070313.1/wozzeck_Solaris8/mozilla/tests_results/security/nssamdrhel4.3/client full of cores.
| Reporter | ||
Comment 5•19 years ago
|
||
This core found on Linux 2.6 (nssamdrhel4), 64bit DBG build.
| Assignee | ||
Comment 6•19 years ago
|
||
Did check how certPrefix was initialized. Assumed it to be inited NULL. Instead it was initialized with stack allocated empty string.
Attachment #258472 -
Flags: review?(nelson)
Comment 7•19 years ago
|
||
Comment on attachment 258472 [details] [diff] [review]
fix selfserv crash created by prev patch
I'd like to suggest a simpler patch for this.
Here is an outline of it.
> PRBool debugCache = PR_FALSE; /* bug 90518 */
>+ char emptyString[] = { "" };
> char* certPrefix = emptyString;
>- if (certPrefix) {
>+ if (certPrefix && certPrefix != emptyString) {
> PORT_Free(certPrefix);
> }
Attachment #258472 -
Flags: review?(nelson) → review-
| Assignee | ||
Comment 8•19 years ago
|
||
Attachment #258472 -
Attachment is obsolete: true
Attachment #258480 -
Flags: review?(nelson)
Comment 9•19 years ago
|
||
Comment on attachment 258480 [details] [diff] [review]
patch with suggested fix
r=nelson
Attachment #258480 -
Flags: review?(nelson) → review+
| Assignee | ||
Comment 10•19 years ago
|
||
Comment on attachment 258480 [details] [diff] [review]
patch with suggested fix
second review for the branch
Attachment #258480 -
Flags: superreview?(neil.williams)
| Assignee | ||
Comment 11•19 years ago
|
||
/cvsroot/mozilla/security/nss/cmd/selfserv/selfserv.c,v <-- selfserv.c
new revision: 1.77; previous revision: 1.76
Comment 12•19 years ago
|
||
Comment on attachment 258480 [details] [diff] [review]
patch with suggested fix
r=naw
Attachment #258480 -
Flags: superreview?(neil.williams) → superreview+
Comment 13•19 years ago
|
||
Alexei, is this fixed ? If so, please check into the branch and close the bug. Thanks.
| Assignee | ||
Comment 14•19 years ago
|
||
both fixes are checked into 3.11 branch.
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
•