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)
Sun, May 17, 6:30 AM
Unknown Object (File)
Sun, May 17, 6:20 AM
Unknown Object (File)
Fri, May 15, 5:19 AM
Unknown Object (File)
Fri, May 15, 12:24 AM
Unknown Object (File)
Tue, May 12, 1:14 PM
Unknown Object (File)
Sat, May 9, 8:35 PM
Unknown Object (File)
Sat, May 9, 8:26 PM
Unknown Object (File)
Fri, Apr 24, 8:46 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