Page MenuHomeFreeBSD

Fix memory leaks in dhclient

Authored by on Mar 5 2017, 2:07 PM.



parse.c parse_string
When parse_semi fails, free s before returning

parse.c parse_numeric_aggregate
The memory assigned to bufp is complicated, it can either be from the input parameter buf or allocated locally. Introduce a new variable lbufp to track when it is assigned locally and to free it when appropriate.

Test Plan

Run clang's static analyzer, scan-build, to find the problems, run later to show resolutions.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline retitled this revision from to Fix memory leaks in dhclient. updated this object. edited the test plan for this revision. (Show Details) added reviewers: stevek, brooks, jhb. set the repository for this revision to rS FreeBSD src repository.
jhb accepted this revision.Mar 6 2017, 5:39 PM
jhb edited edge metadata.
This revision is now accepted and ready to land.Mar 6 2017, 5:39 PM
This revision was automatically updated to reflect the committed changes.