Closed
Bug 1250499
Opened 9 years ago
Closed 9 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•9 years ago
|
||
Attachment #8722507 -
Flags: review?(mconnor)
Attachment #8722507 -
Flags: review?(ehsan)
Comment 2•9 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•9 years ago
|
||
Attachment #8722955 -
Flags: review?(ehsan)
Comment 4•9 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•9 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•9 years ago
|
Whiteboard: CID 749197 → CID 749197[necko-active]
Updated•9 years ago
|
Keywords: checkin-needed
Updated•9 years ago
|
Keywords: checkin-needed
Updated•9 years ago
|
Summary: [Static Analysis] - possible Resource leak → [Static Analysis][Resource Leak] In function mount_operation_ask_password
| Assignee | ||
Comment 7•9 years ago
|
||
Attachment #8722507 -
Attachment is obsolete: true
Attachment #8722955 -
Attachment is obsolete: true
Attachment #8723523 -
Attachment is obsolete: true
| Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 8•9 years ago
|
||
Dear sheriffs: this can be landed without a try run. Thanks!
Keywords: checkin-needed
Comment 10•9 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•