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)
Tue, Dec 30, 11:12 AM
Unknown Object (File)
Nov 24 2025, 5:58 AM
Unknown Object (File)
Nov 14 2025, 3:56 AM
Unknown Object (File)
Nov 13 2025, 10:12 AM
Unknown Object (File)
Nov 1 2025, 12:16 AM
Unknown Object (File)
Oct 28 2025, 1:14 AM
Unknown Object (File)
Oct 27 2025, 2:28 PM
Unknown Object (File)
Oct 19 2025, 10:45 PM
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