diff options
author | Alan Modra <amodra@gmail.com> | 2022-12-08 11:45:12 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-12-08 11:46:22 +1030 |
commit | 57336e2e4d05eaac6367400e6ce3aed24f838f2c (patch) | |
tree | 72fcf8c5b71913183932866d43f0619cea340950 /libctf | |
parent | b0f110a5ea0914aff686bab0f511d749433104d8 (diff) | |
download | gdb-57336e2e4d05eaac6367400e6ce3aed24f838f2c.zip gdb-57336e2e4d05eaac6367400e6ce3aed24f838f2c.tar.gz gdb-57336e2e4d05eaac6367400e6ce3aed24f838f2c.tar.bz2 |
libctf: avoid potential double free
* ctf-link.c (ctf_link_add_cu_mapping): Set t NULL after free.
Diffstat (limited to 'libctf')
-rw-r--r-- | libctf/ctf-link.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libctf/ctf-link.c b/libctf/ctf-link.c index 702f2b4..902b440 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) { |