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)
Dec 22 2023, 9:35 PM
Unknown Object (File)
Oct 25 2023, 9:58 AM
Unknown Object (File)
Aug 28 2023, 3:50 AM
Unknown Object (File)
Jul 23 2023, 6:24 PM
Unknown Object (File)
Jul 6 2023, 7:39 AM
Unknown Object (File)
Jun 9 2023, 3:11 PM
Unknown Object (File)
Jun 7 2023, 2:48 AM
Unknown Object (File)
Apr 24 2023, 3:51 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