From 9efb7cdef40b3df83a1ec3cdbda882b1a626bb0e Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 10 Jun 2025 22:57:46 +0930 Subject: [PATCH] dlltool invalid free This is a followup to commt 619f863c55ca "dlltool memory leaks". The name passed to def_name is freed, so if missing we can't just use "". strdup it. * defparse.y (opt_name): xstrdup empty string. --- binutils/defparse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binutils/defparse.y b/binutils/defparse.y index d50739eb801..a2c4c4b6196 100644 --- a/binutils/defparse.y +++ b/binutils/defparse.y @@ -213,7 +213,7 @@ opt_name2: ID { $$ = $1; } } ; opt_name: opt_name2 { $$ =$1; } - | { $$=""; } + | { $$ = xstrdup (""); } ; opt_ordinal: -- 2.47.2