diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2021-03-02 15:10:05 +0000 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2021-03-02 15:10:09 +0000 |
commit | 8e7e446446b2de0c44e453a298718a0411f47205 (patch) | |
tree | df2cc2f2436e05cf6eaa192a46fff9c61881751c /libctf/ctf-link.c | |
parent | libctf: fix signed/unsigned comparison confusion (diff) | |
download | binutils-gdb-8e7e446446b2de0c44e453a298718a0411f47205.tar.gz binutils-gdb-8e7e446446b2de0c44e453a298718a0411f47205.tar.bz2 binutils-gdb-8e7e446446b2de0c44e453a298718a0411f47205.zip |
libctf: free ctf_dynsyms properly
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.
Diffstat (limited to 'libctf/ctf-link.c')
-rw-r--r-- | libctf/ctf-link.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libctf/ctf-link.c b/libctf/ctf-link.c index 05733a0cb7d..882d4297e4f 100644 --- a/libctf/ctf-link.c +++ b/libctf/ctf-link.c @@ -1580,7 +1580,7 @@ ctf_link_shuffle_syms (ctf_dict_t *fp) 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; } |