Page MenuHomeFreeBSD

Fix a memory leak in libctf
ClosedPublic

Authored by trix_juniper.net on Feb 23 2017, 4:41 PM.

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
Lint
Lint Skipped
Unit
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.
markj accepted this revision.Feb 23 2017, 5:32 PM
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

markj closed this revision.Feb 23 2017, 6:00 PM

r314153