When there is an error with the first entry we might already have allocated
the memory but not yet set cnt to 1. Just always free the memory on error.
free (NULL) is a nop anyway and doesn't matter on a failure path.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
+2015-06-18 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf_getpubnames.c (get_offsets): Always free mem on error.
+
2015-06-18 Mark Wielaard <mjw@redhat.com>
* dwarf_getmacros.c (get_macinfo_table): Return NULL when
if (mem == NULL || cnt == 0)
{
+ free (mem);
__libdw_seterrno (DWARF_E_NO_ENTRY);
return -1;
}