diff options
author | Alan Modra <amodra@gmail.com> | 2022-06-17 09:00:41 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-06-17 21:08:41 +0930 |
commit | 0ebc886149c22aceaf8ed74267821a59ca9d03eb (patch) | |
tree | 04e3dd39db037fb5d82055485e12f3c3b0da2f73 /binutils/stabs.c | |
parent | dfea48fc0f040e87c5d7d4fc34c0610dc0039ad1 (diff) | |
download | gdb-0ebc886149c22aceaf8ed74267821a59ca9d03eb.zip gdb-0ebc886149c22aceaf8ed74267821a59ca9d03eb.tar.gz gdb-0ebc886149c22aceaf8ed74267821a59ca9d03eb.tar.bz2 |
PR29254, memory leak in stab_demangle_v3_arg
PR 29254
* stabs.c (stab_demangle_v3_arg): Free dt on failure path.
Diffstat (limited to 'binutils/stabs.c')
-rw-r--r-- | binutils/stabs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/binutils/stabs.c b/binutils/stabs.c index 2b52416..796ff85 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); } |