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)
Dec 21 2023, 10:06 PM
Unknown Object (File)
Dec 20 2023, 2:20 AM
Unknown Object (File)
Dec 9 2023, 8:11 AM
Unknown Object (File)
Nov 18 2023, 10:27 AM
Unknown Object (File)
Nov 18 2023, 3:44 AM
Unknown Object (File)
Nov 18 2023, 3:17 AM
Unknown Object (File)
Nov 18 2023, 3:06 AM
Unknown Object (File)
Oct 30 2023, 11:04 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.