If we allocated the match results array ourselves, then free it when
we detect invalid DWARF and return an error.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
2016-04-14 Mark Wielaard <mjw@redhat.com>
+ * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Free match
+ on invalid DWARF if we allocated it.
+
+2016-04-14 Mark Wielaard <mjw@redhat.com>
+
* linux-proc-maps.c (proc_maps_report): Free last_file on bad file
mapping.
if (unlikely (line->file >= line->files->nfiles))
{
+ if (*nsrcs == 0)
+ free (match);
__libdwfl_seterrno (DWFL_E (LIBDW, DWARF_E_INVALID_DWARF));
return -1;
}