]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
libctf, string: remove movable refs properly
authorNick Alcock <nick.alcock@oracle.com>
Mon, 13 Jan 2025 14:49:14 +0000 (14:49 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 28 Feb 2025 15:13:23 +0000 (15:13 +0000)
Ever since pending refs were replaced with movable refs, we were failing
to remove movable ref backpointers properly on ctf_remove_ref.  I don't
see how this could cause any problem but a memory leak, but since we
do ultimately write down refs, leaking references to refs is still
risky: best to fix this.

libctf/ctf-string.c

index 84f0e0d9e4fc70177f96d69f0d579b70134a296b..4a26541166a75ad1be76282a573f50d621c58190 100644 (file)
@@ -611,6 +611,7 @@ ctf_str_remove_ref (ctf_dict_t *fp, const char *str, uint32_t *ref)
       if (aref->caf_ref == ref)
        {
          ctf_list_delete (&atom->csa_refs, aref);
+         ctf_dynhash_remove (fp->ctf_str_movable_refs, ref);
          free (aref);
        }
     }