aboutsummaryrefslogtreecommitdiff
path: root/binutils/stabs.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-06-17 09:00:41 +0930
committerAlan Modra <amodra@gmail.com>2022-06-17 21:08:41 +0930
commit0ebc886149c22aceaf8ed74267821a59ca9d03eb (patch)
tree04e3dd39db037fb5d82055485e12f3c3b0da2f73 /binutils/stabs.c
parentdfea48fc0f040e87c5d7d4fc34c0610dc0039ad1 (diff)
downloadgdb-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.c5
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);
}