]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
ldelf_before_allocation leak
authorAlan Modra <amodra@gmail.com>
Mon, 20 Jan 2025 07:11:56 +0000 (17:41 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 20 Jan 2025 07:46:15 +0000 (18:16 +1030)
commitbf2da5d57d7532855e56538a4a7242c705b1d27d
tree0c409dd16e39296d98f037f97f50fec29c635f63
parentc785932bb5ae8f8b9e8857c6436e13f051710858
ldelf_before_allocation leak

ldelf_before_allocation is passed the audit and depaudit strings built
from command line args, then possibly adds to the depaudit string,
freeing the original.  The new string isn't freed.  Fix this leak by
keeping the string attached to the static vars.

* ldelf.c (ldelf_before_allocation): Pass char** for audit
and depaudit.  Adjust uses.
* ldelf.h (ldelf_before_allocation): Update prototype.
* gld${EMULATION_NAME}_before_allocation: Update call.
ld/emultempl/elf.em
ld/ldelf.c
ld/ldelf.h