AddMesaSysfsPaths: Resource leak on dir

RESOLVED FIXED in Firefox 57

Status

()

defect
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: sylvestre, Assigned: sylvestre)

Tracking

(Blocks 1 bug, {coverity})

Trunk
mozilla58
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox57 fixed, firefox58 fixed)

Details

(Whiteboard: [CID 1419035])

Attachments

(1 attachment)

Comment hidden (empty)
Comment hidden (mozreview-request)

Comment 2

2 years ago
mozreview-review
Comment on attachment 8916519 [details]
Bug 1406845 - AddMesaSysfsPaths: Resource leak on dir

https://reviewboard.mozilla.org/r/187646/#review192722

I missed this because my local manpages don't mention the existence of closedir anywhere in the opendir manpage, aside listing it among many other lib calls in SEE ALSO.
Attachment #8916519 - Flags: review+

Comment 3

2 years ago
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/656e8186307b
AddMesaSysfsPaths: Resource leak on dir r=gcp
Comment on attachment 8916519 [details]
Bug 1406845 - AddMesaSysfsPaths: Resource leak on dir

https://reviewboard.mozilla.org/r/187646/#review192824

Well that's embarrassing.  (And I'm considering filing a bug to add UniquePtr-based wrappers for everything from `FILE*` to `posix_spawn_file_actions_t` so it's harder to make this kind of mistake in the future.)
Attachment #8916519 - Flags: review?(jld) → review+
(Assignee)

Comment 5

2 years ago
Well, C and C++ are embarrassing ... :)
This is why we run static analyzers. We are working on detecting this pattern at review phase.
https://hg.mozilla.org/mozilla-central/rev/656e8186307b
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Comment on attachment 8916519 [details]
Bug 1406845 - AddMesaSysfsPaths: Resource leak on dir

This is needed for uplifting the fix for bug 1401666 to 57.
Attachment #8916519 - Flags: approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.