From: Alan Modra Date: Mon, 20 Jan 2025 07:11:56 +0000 (+1030) Subject: ldelf_before_allocation leak X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf2da5d57d7532855e56538a4a7242c705b1d27d;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/ld/emultempl/elf.em b/ld/emultempl/elf.em index 777f7204038..9dcb52e7514 100644 --- a/ld/emultempl/elf.em +++ b/ld/emultempl/elf.em @@ -170,7 +170,7 @@ fragment <