summaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-06-20 10:39:31 +0930
committerAlan Modra <amodra@gmail.com>2022-06-20 10:40:50 +0930
commit0d02e70b197c786f26175b9a73f94e01d14abdab (patch)
treec6fec4bc06ebe6249c03260b64d3e3ce9d12254a /binutils
parent8a24927bc8dbf6beac2000593b21235c3796dc35 (diff)
PR29262, memory leak in pr_function_type
PR 29262 * prdbg.c (pr_function_type): Free "s" on failure path.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/prdbg.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/binutils/prdbg.c b/binutils/prdbg.c
index c1e41628d2..bb42a5b6c2 100644
--- a/binutils/prdbg.c
+++ b/binutils/prdbg.c
@@ -742,12 +742,9 @@ pr_function_type (void *p, int argcount, bool varargs)
strcat (s, ")");
- if (! substitute_type (info, s))
- return false;
-
+ bool ret = substitute_type (info, s);
free (s);
-
- return true;
+ return ret;
}
/* Turn the top type on the stack into a reference to that type. */