Page MenuHomeFreeBSD

Fix a memory leak in libctf
ClosedPublic

Authored by trix_juniper.net on Feb 23 2017, 4:41 PM.
Tags
None
Referenced Files
F132059526: D9767.diff
Mon, Oct 13, 7:31 AM
Unknown Object (File)
Sat, Oct 11, 10:25 PM
Unknown Object (File)
Sat, Oct 11, 10:25 PM
Unknown Object (File)
Sat, Oct 11, 1:09 PM
Unknown Object (File)
Wed, Sep 17, 3:27 PM
Unknown Object (File)
Mon, Sep 15, 9:26 AM
Unknown Object (File)
Mon, Sep 15, 2:14 AM
Unknown Object (File)
Sep 9 2025, 12:46 PM
Subscribers

Details

Reviewers
markj
stevek
Summary

ctf_lib.c ctf_fdopen has a memory leak, when the allocation of sp32 is sucessful but next statement fails.

Free sp32 before returning. Assume free handles a null pointer.

Test Plan

Run clang's static analyzer, scan-build, before to reproduce the problem, run after to verify proble 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 a memory leak in libctf.
trix_juniper.net updated this object.
trix_juniper.net edited the test plan for this revision. (Show Details)
trix_juniper.net added reviewers: stevek, markj.
trix_juniper.net set the repository for this revision to rS FreeBSD src repository - subversion.
markj edited edge metadata.

Looks good to me, thanks. Would you like me to commit this and the libdtrace change?

This revision is now accepted and ready to land.Feb 23 2017, 5:32 PM

Yes, that would be helpful.
At this time, I do not have any more static analysis fixes for dtrace.
Thanks
Tom