Page MenuHomeFreeBSD

Fix memory leak in memcontrol
AcceptedPublic

Authored by trix_juniper.net on Mar 21 2017, 1:16 PM.
Tags
Referenced Files
Unknown Object (File)
Sat, Mar 28, 12:51 AM
Unknown Object (File)
Fri, Mar 27, 2:21 PM
Unknown Object (File)
Thu, Mar 26, 5:19 AM
Unknown Object (File)
Wed, Mar 25, 7:34 AM
Unknown Object (File)
Sun, Mar 22, 7:21 PM
Unknown Object (File)
Feb 28 2026, 10:19 AM
Unknown Object (File)
Feb 20 2026, 9:55 AM
Unknown Object (File)
Jan 31 2026, 4:02 AM
Subscribers

Details

Reviewers
eadler
Summary

memcontrol.c clearfunc
Free 'owner' after use

Test Plan

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

Diff Detail

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

Event Timeline

ed added inline comments.
usr.sbin/memcontrol/memcontrol.c
280

Technically speaking you should also put a free() call above the strdup()... :-)

This revision is now accepted and ready to land.Mar 21 2017, 2:32 PM
This revision now requires review to proceed.Nov 21 2017, 9:43 PM
This revision is now accepted and ready to land.Apr 21 2018, 4:55 PM

obv address @ed's comments too