From: Alan Modra Date: Thu, 16 Jun 2022 23:30:41 +0000 (+0930) Subject: PR29254, memory leak in stab_demangle_v3_arg X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0ebc886149c22aceaf8ed74267821a59ca9d03eb;p=binutils-gdb.git PR29254, memory leak in stab_demangle_v3_arg PR 29254 * stabs.c (stab_demangle_v3_arg): Free dt on failure path. --- diff --git a/binutils/stabs.c b/binutils/stabs.c index 2b5241637c1..796ff85b86a 100644 --- a/binutils/stabs.c +++ b/binutils/stabs.c @@ -5467,7 +5467,10 @@ stab_demangle_v3_arg (void *dhandle, struct stab_handle *info, dc->u.s_binary.right, &varargs); if (pargs == NULL) - return NULL; + { + free (dt); + return NULL; + } return debug_make_function_type (dhandle, dt, pargs, varargs); }