From bf2da5d57d7532855e56538a4a7242c705b1d27d Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 20 Jan 2025 17:41:56 +1030 Subject: [PATCH] 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 | 2 +- ld/ldelf.c | 6 +++--- ld/ldelf.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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 <