public inbox for binutils-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] PR29261, memory leak in parse_stab_struct_fields
@ 2022-06-20 1:51 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-06-20 1:51 UTC (permalink / raw)
To: bfd-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8a24927bc8dbf6beac2000593b21235c3796dc35
commit 8a24927bc8dbf6beac2000593b21235c3796dc35
Author: Alan Modra <amodra@gmail.com>
Date: Mon Jun 20 10:39:13 2022 +0930
PR29261, memory leak in parse_stab_struct_fields
PR 29261
* stabs.c (parse_stab_struct_fields): Free "fields" on failure path.
Diff:
---
binutils/stabs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/binutils/stabs.c b/binutils/stabs.c
index 796ff85b86a..bf3f578cbcc 100644
--- a/binutils/stabs.c
+++ b/binutils/stabs.c
@@ -2367,7 +2367,10 @@ parse_stab_struct_fields (void *dhandle,
if (! parse_stab_one_struct_field (dhandle, info, pp, p, fields + c,
staticsp, p_end))
- return false;
+ {
+ free (fields);
+ return false;
+ }
++c;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-20 1:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-20 1:51 [binutils-gdb] PR29261, memory leak in parse_stab_struct_fields Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).