Closed
Bug 1471943
Opened 6 years ago
Closed 6 years ago
NetworkInfoServiceLinux.cpp: Possible socket resource leak
Categories
(Core :: Networking: WebSockets, defect, P3)
Core
Networking: WebSockets
Tracking
()
RESOLVED
FIXED
mozilla63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: rbartlensky, Assigned: rbartlensky)
References
Details
(Whiteboard: [necko-triaged])
Attachments
(1 file)
The infer static analyzer reported a resource leak here: https://searchfox.org/mozilla-central/source/netwerk/base/NetworkInfoServiceLinux.cpp#64 and I think it might be right. The autoCloseSocket is defined at https://searchfox.org/mozilla-central/source/netwerk/base/NetworkInfoServiceLinux.cpp#34-36 and it is a ScopeExit object. In this case it holds a file descriptor, and when it goes out of scope runs the system call close. If the execution manages to reach https://searchfox.org/mozilla-central/source/netwerk/base/NetworkInfoServiceLinux.cpp#64 the ScopeExit object will no longer free the resource (because the release method sets a variable which makes the destructor skip the freeing of the resource), thus causing a resource leak. It can be seen here: https://searchfox.org/mozilla-central/source/netwerk/base/NetworkInfoServiceLinux.cpp#57,69 that the file descriptor is passed to another function before executing the line in question, but the file descriptor is not closed anywhere.
Updated•6 years ago
|
Summary: Possible socket resource leak → NetworkInfoServiceLinux.cpp: Possible socket resource leak
Updated•6 years ago
|
Priority: -- → P3
Whiteboard: [necko-triaged]
Comment hidden (mozreview-request) |
Assignee | ||
Updated•6 years ago
|
Attachment #8989198 -
Flags: review?(bpostelnicu)
Updated•6 years ago
|
Attachment #8989198 -
Flags: review?(bpostelnicu) → review?(valentin.gosu)
Comment 2•6 years ago
|
||
I think valentin should take care of this review, since he's the reviewer for this component.
Comment 3•6 years ago
|
||
mozreview-review |
Comment on attachment 8989198 [details] Bug 1471943: Remove release call to ensure socket is closed. https://reviewboard.mozilla.org/r/254250/#review261584 That's a good catch.
Attachment #8989198 -
Flags: review?(valentin.gosu) → review+
Pushed by bpostelnicu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d53abfceeac2 Remove release call to ensure socket is closed. r=valentin
Comment 5•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d53abfceeac2
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•