Closed
Bug 619813
Opened 14 years ago
Closed 14 years ago
sftkdb_DeleteSecmodDB leaks block if fgets fails after continue
Categories
(NSS :: Libraries, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: timeless, Assigned: timeless)
References
()
Details
(Keywords: coverity, memory-leak)
Attachments
(1 file, 1 obsolete file)
1.40 KB,
patch
|
timeless
:
review+
nelson
:
review+
|
Details | Diff | Splinter Review |
fwiw, colapses is misspelled 533 sftkdb_DeleteSecmodDB(SDBType dbType, const char *appName, 542 char *block = NULL; 588 while (fgets(line, sizeof(line), fd) != NULL) { 612 block = sftkdb_DupCat(block,line); 613 continue; the code here assumes that after continue fgets will succeed again. this seems unlikely.
Comment 2•14 years ago
|
||
Comment on attachment 498300 [details] [diff] [review] proposal r=nelson
Attachment #498300 -
Flags: review?(nelson) → review+
Comment 3•14 years ago
|
||
Comment on attachment 498300 [details] [diff] [review] proposal Thanks for the patch. You just need to call PORT_Free(block); PORT_Free does nothing if the input is NULL, and it's not necessary to set 'block' to NULL because we're returning from the function immediately.
Attachment #498300 -
Attachment is obsolete: true
Attachment #501647 -
Flags: review+
Updated•14 years ago
|
Attachment #501647 -
Flags: review+
Comment 5•14 years ago
|
||
Bug 619813: sftkdb_DeleteSecmodDB leaks block if fgets fails after continue Patch contributed by Timeless <timeless@mozdev.org>, r=nelson Checking in softoken/sftkmod.c; new revision: 1.8; previous revision: 1.7
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•