[binutils-gdb] ppc plt sym memory leak

Alan Modra amodra@sourceware.org
Thu Jan 16 09:31:20 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=86790dfe16097f8aee84c007efdef40759065e8c

commit 86790dfe16097f8aee84c007efdef40759065e8c
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Jan 15 09:11:55 2025 +1030

    ppc plt sym memory leak
    
            * elf32-ppc.c (add_stub_sym): Alloc the sym name.

Diff:
---
 bfd/elf32-ppc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index cb5a0088ad9..2ea1574a026 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -4985,7 +4985,7 @@ add_stub_sym (struct plt_entry *ent,
   len3 = 0;
   if (ent->sec)
     len3 = strlen (ent->sec->name);
-  name = bfd_malloc (len1 + len2 + len3 + 9);
+  name = bfd_alloc (info->output_bfd, len1 + len2 + len3 + 9);
   if (name == NULL)
     return false;
   sprintf (name, "%08x", (unsigned) ent->addend & 0xffffffff);


More information about the Binutils-cvs mailing list