[binutils-gdb] Use stat_alloc in plugin

Alan Modra amodra@sourceware.org
Sun Jan 19 21:17:22 GMT 2025


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

commit f7b0dfe03050f86062b8400f22c2a3e01eb0208c
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Jan 16 22:57:43 2025 +1030

    Use stat_alloc in plugin
    
    We never free the tv array.
    
            * plugin.c (plugin_load_plugins): Use stat_alloc.

Diff:
---
 ld/plugin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ld/plugin.c b/ld/plugin.c
index 4a21d130742..1e7fde3183a 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -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.  */


More information about the Binutils-cvs mailing list