From: Alan Modra Date: Thu, 8 Dec 2022 01:15:12 +0000 (+1030) Subject: libctf: avoid potential double free X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=57336e2e4d05eaac6367400e6ce3aed24f838f2c;p=binutils-gdb.git libctf: avoid potential double free * ctf-link.c (ctf_link_add_cu_mapping): Set t NULL after free. --- diff --git a/libctf/ctf-link.c b/libctf/ctf-link.c index 702f2b4d5fe..902b4408cd6 100644 --- a/libctf/ctf-link.c +++ b/libctf/ctf-link.c @@ -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) {