]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Leak in i386_elf_section_change_hook
authorAlan Modra <amodra@gmail.com>
Wed, 21 Feb 2024 21:11:46 +0000 (07:41 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 21 Feb 2024 21:27:15 +0000 (07:57 +1030)
notes_alloc is perfect for assorted memory you can't free easily
and/or would rather leave freeing until just before exit.

* config/tc-i386.c (i386_elf_section_change_hook): Use notes_alloc.

gas/config/tc-i386.c

index ed7c4a5ea03097d27c2dc8bf6865ad7d5a5443ec..c56ca4a2b4b8f29e6cb73551baa99d9638d1f1ad 100644 (file)
@@ -17627,7 +17627,7 @@ i386_elf_section_change_hook (void)
       break;
   if (!curr)
     {
-      curr = XNEW (struct i386_segment_info);
+      curr = notes_alloc (sizeof (*curr));
       curr->subseg = info->subseg;
       curr->next = NULL;
       prev->next = curr;