dwarf_loader: Make dwarf_cu__delete() accept NULL, just like free()

To facilitate error handling, where we would be checking for NULL in
multiple places.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2021-05-26 09:26:28 -03:00
parent 8772c9d827
commit f3957627bb
1 changed files with 3 additions and 0 deletions

View File

@ -150,6 +150,9 @@ static struct dwarf_cu *dwarf_cu__new(void)
static void dwarf_cu__delete(struct cu *cu)
{
if (cu == NULL || cu->priv == NULL)
return;
struct dwarf_cu *dcu = cu->priv;
free(dcu->hash_tags);
dcu->hash_tags = NULL;