]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use stat_alloc in plugin
authorAlan Modra <amodra@gmail.com>
Thu, 16 Jan 2025 12:27:43 +0000 (22:57 +1030)
committerAlan Modra <amodra@gmail.com>
Sun, 19 Jan 2025 20:43:46 +0000 (07:13 +1030)
We never free the tv array.

* plugin.c (plugin_load_plugins): Use stat_alloc.

ld/plugin.c

index 4a21d1307426b2b7f6fe18d57aa37ffe577137b7..1e7fde3183a77530593f2bccc5c1757324b8407f 100644 (file)
@@ -1120,7 +1120,7 @@ plugin_load_plugins (void)
     }
 
   /* Allocate tv array and initialise constant part.  */
-  my_tv = xmalloc ((max_args + 1 + tv_header_size) * sizeof *my_tv);
+  my_tv = stat_alloc ((max_args + 1 + tv_header_size) * sizeof (*my_tv));
   set_tv_header (my_tv);
 
   /* Pass over plugins again, activating them.  */