Closed Bug 1406845 Opened 3 years ago Closed 3 years ago

AddMesaSysfsPaths: Resource leak on dir

Categories

(Core :: Security: Process Sandboxing, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox57 --- fixed
firefox58 --- fixed

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: [CID 1419035])

Attachments

(1 file)

No description provided.
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+
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+
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
Closed: 3 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.