libdwfl: Fix build_id memory leak in dwfl_segment_report_module.
authorMark Wielaard <mjw@redhat.com>
Mon, 23 Dec 2013 22:21:59 +0000 (23:21 +0100)
committerMark Wielaard <mjw@redhat.com>
Tue, 31 Dec 2013 12:58:32 +0000 (13:58 +0100)
commitb20ca0bd7fba0743fa97df2d42f6fd3c7b206039
tree1476cecc4bf2b87fdf52c02e90d781dc6bc78645
parenta6141d27691a68a4af5eb48ab10d27e74d3c2a6b
libdwfl: Fix build_id memory leak in dwfl_segment_report_module.

We might already have allocated memory to hold the build_id early in
consider_notes when we called consider_phdr for the program headers
we've read from the image. We would leak that memory when we don't use
it then because we return early/fail. This can be because either we
didn't find the correct bias or we skip the module because it would
conflict in address space with any already existing module of DWFL.
In both cases explicitly free the build_id memory.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
libdwfl/ChangeLog
libdwfl/dwfl_segment_report_module.c