From: Alan Modra Date: Tue, 10 Jun 2025 13:27:46 +0000 (+0930) Subject: dlltool invalid free X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9efb7cdef40b3df83a1ec3cdbda882b1a626bb0e;p=thirdparty%2Fbinutils-gdb.git 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. --- 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: