Closed
Bug 341114
Opened 19 years ago
Closed 19 years ago
Coverity 517 SECU_ParseCommandLine leaks optstate
Categories
(NSS :: Tools, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
3.11.3
People
(Reporter: nelson, Assigned: alvolkov.bgs)
Details
(Keywords: coverity, Whiteboard: CID 517)
Attachments
(1 file, 1 obsolete file)
2.17 KB,
patch
|
nelson
:
review+
|
Details | Diff | Splinter Review |
SECU_ParseCommandLine allocates an "optstate" and returns without destroying it.
It should call PL_DestroyOptState(optstate) to destroy it.
Reporter | ||
Comment 1•19 years ago
|
||
CID 517
Summary: SECU_ParseCommandLine leaks optstate → Coverity 517 SECU_ParseCommandLine leaks optstate
Whiteboard: CID 517
Assignee | ||
Updated•19 years ago
|
Assignee: nobody → alexei.volkov.bugs
Assignee | ||
Comment 2•19 years ago
|
||
Deallocate optstate as well as optstring.
Attachment #226883 -
Flags: review?(nelson)
Reporter | ||
Comment 3•19 years ago
|
||
Comment on attachment 226883 [details] [diff] [review]
fix v1
> optstring[j] = '\0';
> optstate = PL_CreateOptState(argc, argv, optstring);
>+ if (!optstate) {
optstring is leaked here.
>+ return SECFailure;
>+ }
Attachment #226883 -
Attachment description: fix → fix v1
Attachment #226883 -
Flags: review?(nelson) → review-
Assignee | ||
Comment 4•19 years ago
|
||
Attachment #226883 -
Attachment is obsolete: true
Attachment #227163 -
Flags: review?(nelson)
Reporter | ||
Comment 5•19 years ago
|
||
Comment on attachment 227163 [details] [diff] [review]
free optstring if optstate allocation fails
Don't indent loser. r=nelson
>+
>+ loser:
>+ PL_DestroyOptState(optstate);
Attachment #227163 -
Flags: review?(nelson) → review+
Reporter | ||
Updated•19 years ago
|
Priority: -- → P3
Target Milestone: --- → 3.11.3
Assignee | ||
Comment 6•19 years ago
|
||
/cvsroot/mozilla/security/nss/cmd/lib/secutil.c,v <-- secutil.c
new revision: 1.74; previous revision: 1.73
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•