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:
parent
8772c9d827
commit
f3957627bb
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue