In the "no symbols" case (commonplace for executables), we were freeing
the ctf_dynsyms using free(), instead of ctf_dynhash_destroy(), leaking
a little memory.
(This is harmless in the common case of ld usage, but libctf might be
used by persistent processes too.)
libctf/ChangeLog
2021-03-02 Nick Alcock <nick.alcock@oracle.com>
* ctf-link.c (ctf_link_shuffle_syms): Free ctf_dynsyms properly.
+2021-03-02 Nick Alcock <nick.alcock@oracle.com>
+
+ * ctf-link.c (ctf_link_shuffle_syms): Free ctf_dynsyms properly.
+
2021-03-02 Nick Alcock <nick.alcock@oracle.com>
* ctf-dump.c (ctf_dump_format_type): Fix signed/unsigned confusion.
if (!ctf_dynhash_elements (fp->ctf_dynsyms))
{
ctf_dprintf ("No symbols: not a final link.\n");
- free (fp->ctf_dynsyms);
+ ctf_dynhash_destroy (fp->ctf_dynsyms);
fp->ctf_dynsyms = NULL;
return 0;
}