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.
This commit is contained in:
parent
cf6a0b989a
commit
8e7e446446
2 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
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>
|
2021-03-02 Nick Alcock <nick.alcock@oracle.com>
|
||||||
|
|
||||||
* ctf-dump.c (ctf_dump_format_type): Fix signed/unsigned confusion.
|
* ctf-dump.c (ctf_dump_format_type): Fix signed/unsigned confusion.
|
||||||
|
|
|
@ -1580,7 +1580,7 @@ ctf_link_shuffle_syms (ctf_dict_t *fp)
|
||||||
if (!ctf_dynhash_elements (fp->ctf_dynsyms))
|
if (!ctf_dynhash_elements (fp->ctf_dynsyms))
|
||||||
{
|
{
|
||||||
ctf_dprintf ("No symbols: not a final link.\n");
|
ctf_dprintf ("No symbols: not a final link.\n");
|
||||||
free (fp->ctf_dynsyms);
|
ctf_dynhash_destroy (fp->ctf_dynsyms);
|
||||||
fp->ctf_dynsyms = NULL;
|
fp->ctf_dynsyms = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue