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
Unknown Object (File)
Oct 9 2024, 1:21 AM
Unknown Object (File)
Oct 6 2024, 2:11 AM
Unknown Object (File)
Oct 5 2024, 6:11 PM
Unknown Object (File)
Oct 5 2024, 3:42 PM
Unknown Object (File)
Oct 3 2024, 12:05 AM
Unknown Object (File)
Oct 2 2024, 11:05 PM
Unknown Object (File)
Oct 1 2024, 3:12 AM
Unknown Object (File)
Sep 26 2024, 9:09 AM
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