Closed
Bug 1250499
Opened 8 years ago
Closed 8 years ago
[Static Analysis][Resource Leak] In function mount_operation_ask_password
Categories
(Core :: Networking: Cookies, defect)
Core
Networking: Cookies
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: radu.stoica, Assigned: radu.stoica)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: CID 749197[necko-active])
Attachments
(1 file, 3 obsolete files)
1.13 KB,
patch
|
Details | Diff | Splinter Review |
The Static Analysis tool Coverity added \ possible Resource leak (RESOURCE_LEAK)
Assignee | ||
Comment 1•8 years ago
|
||
Attachment #8722507 -
Flags: review?(mconnor)
Attachment #8722507 -
Flags: review?(ehsan)
Comment 2•8 years ago
|
||
Comment on attachment 8722507 [details] [diff] [review] bug_1250499.diff Review of attachment 8722507 [details] [diff] [review]: ----------------------------------------------------------------- ::: extensions/gio/nsGIOProtocolHandler.cpp @@ +867,5 @@ > &pass, &retval); > } > if (NS_FAILED(rv) || !retval) { // was || user == '\0' || pass == '\0' > g_mount_operation_reply(mount_op, G_MOUNT_OPERATION_ABORTED); > + free(user); You're still leaking pass with this patch. You need to free them both here.
Attachment #8722507 -
Flags: review?(mconnor)
Attachment #8722507 -
Flags: review?(ehsan)
Attachment #8722507 -
Flags: review-
Assignee | ||
Comment 3•8 years ago
|
||
Attachment #8722955 -
Flags: review?(ehsan)
Comment 4•8 years ago
|
||
Comment on attachment 8722955 [details] [diff] [review] bug_1250499.diff Review of attachment 8722955 [details] [diff] [review]: ----------------------------------------------------------------- ::: extensions/gio/nsGIOProtocolHandler.cpp @@ +874,5 @@ > + } > + if (pass) { > + free(pass); > + pass = nullptr; > + } free() can deal with a nullptr being passed to it, also since you're returning there is no point in resetting these variables to nullptr since they're on the stack. I think it's enough to just free them both.
Attachment #8722955 -
Flags: review?(ehsan)
Comment 6•8 years ago
|
||
Comment on attachment 8723523 [details] [diff] [review] bug_1250499.diff Review of attachment 8723523 [details] [diff] [review]: ----------------------------------------------------------------- Thank you! r=me
Attachment #8723523 -
Flags: review?(ehsan) → review+
Updated•8 years ago
|
Whiteboard: CID 749197 → CID 749197[necko-active]
Updated•8 years ago
|
Keywords: checkin-needed
Updated•8 years ago
|
Keywords: checkin-needed
Updated•8 years ago
|
Summary: [Static Analysis] - possible Resource leak → [Static Analysis][Resource Leak] In function mount_operation_ask_password
Assignee | ||
Comment 7•8 years ago
|
||
Attachment #8722507 -
Attachment is obsolete: true
Attachment #8722955 -
Attachment is obsolete: true
Attachment #8723523 -
Attachment is obsolete: true
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 8•8 years ago
|
||
Dear sheriffs: this can be landed without a try run. Thanks!
Comment 10•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/fe8939c91205
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•