From 57336e2e4d05eaac6367400e6ce3aed24f838f2c Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 8 Dec 2022 11:45:12 +1030 Subject: [PATCH] libctf: avoid potential double free * ctf-link.c (ctf_link_add_cu_mapping): Set t NULL after free. --- libctf/ctf-link.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 2.30.2