From: Alan Modra Date: Mon, 20 Jun 2022 01:09:13 +0000 (+0930) Subject: PR29261, memory leak in parse_stab_struct_fields X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8a24927bc8dbf6beac2000593b21235c3796dc35;p=binutils-gdb.git PR29261, memory leak in parse_stab_struct_fields PR 29261 * stabs.c (parse_stab_struct_fields): Free "fields" on failure path. --- 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; }