Page MenuHomeFreeBSD

Fix memory leak in autofs
ClosedPublic

Authored by trix_juniper.net on Mar 20 2017, 3:54 PM.
Tags
None
Referenced Files
F144430814: D10063.id26446.diff
Sun, Feb 8, 10:04 AM
F144411178: D10063.id160147.diff
Sun, Feb 8, 7:29 AM
Unknown Object (File)
Fri, Jan 30, 6:30 PM
Unknown Object (File)
Sun, Jan 18, 4:51 PM
Unknown Object (File)
Dec 6 2025, 10:18 AM
Unknown Object (File)
Nov 25 2025, 1:48 PM
Unknown Object (File)
Nov 19 2025, 6:29 PM
Unknown Object (File)
Nov 17 2025, 11:03 AM
Subscribers

Details

Summary

common.c create_directory
Free tofree when returning early.

Test Plan

Use clang's static analyzer, scan-build, to find the problem and later to show resolution.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

usr.sbin/autofs/common.c
155

An equivalent way to do this would be to call break instead of return here. I think this is the best way to fix the problem because it means that the cleanup path is equivalent.. but I would get signoff from trasz since he's the autofs developer/maintainer.

This revision is now accepted and ready to land.May 5 2017, 5:23 AM

I'd prefer the "break" as well.

@trix_juniper.net: this patch never made it in to base. Could you please change the return to a break and submit an updated version of the patch, so we can commit it for you?

This revision was automatically updated to reflect the committed changes.