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)
Fri, Sep 4, 6:40 PM
Unknown Object (File)
Fri, Sep 4, 6:22 PM
Unknown Object (File)
Wed, Sep 2, 12:40 AM
Unknown Object (File)
Mon, Aug 31, 12:36 AM
Unknown Object (File)
Sat, Aug 22, 1:17 PM
Unknown Object (File)
Aug 7 2026, 5:20 PM
Unknown Object (File)
Aug 1 2026, 6:06 AM
Unknown Object (File)
Jul 30 2026, 8:51 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