Page MenuHomeFreeBSD

Fix memory leaks in mdmfs
Needs ReviewPublic

Authored by on Feb 23 2017, 4:47 PM.



mdmfs.c main : the local variable mdconfig_arg is allocated but never freed.

mdmfs.c do_mdconfig_attach_au : the local variable linebuf is allocated but never freed.

In both cases, free the memory after its last use.

Test Plan

Run clang static analyzer, scan-build, before to reproduce the problem. Run after to verify problem resolution.

Diff Detail

rS FreeBSD src repository - subversion
Lint Skipped
Unit Tests Skipped

Event Timeline retitled this revision from to Fix memory leaks in mdmfs. updated this object. edited the test plan for this revision. (Show Details) added reviewers: stevek, ak. set the repository for this revision to rS FreeBSD src repository - subversion.

Shouldn't you also free newfs_arg and mount_arg ? edited edge metadata.

I agree these should also be freed.
I took a second look at the scan-view output and it did not complain which is troubling.