Page MenuHomeFreeBSD

Fix memory leaks in mdmfs
Needs ReviewPublic

Authored by trix_juniper.net on Feb 23 2017, 4:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 6:17 AM
Unknown Object (File)
Sat, Dec 21, 2:55 AM
Unknown Object (File)
Nov 22 2024, 3:20 AM
Unknown Object (File)
Oct 8 2024, 11:34 PM
Unknown Object (File)
Oct 5 2024, 9:51 PM
Unknown Object (File)
Oct 2 2024, 8:25 PM
Unknown Object (File)
Sep 30 2024, 10:21 AM
Unknown Object (File)
Sep 24 2024, 3:27 AM
Subscribers

Details

Reviewers
stevek
ak
Summary

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

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

Shouldn't you also free newfs_arg and mount_arg ?

trix_juniper.net 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.