libctf: avoid potential double free

* ctf-link.c (ctf_link_add_cu_mapping): Set t NULL after free.
This commit is contained in:
Alan Modra 2022-12-08 11:45:12 +10:30
parent b0f110a5ea
commit 57336e2e4d

View File

@ -431,7 +431,10 @@ ctf_link_add_cu_mapping (ctf_dict_t *fp, const char *from, const char *to)
}
}
else
free (t);
{
free (t);
t = NULL;
}
if (ctf_dynhash_insert (one_out, f, NULL) < 0)
{