public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PR29254, memory leak in stab_demangle_v3_arg
@ 2022-06-17 11:57 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-06-17 11:57 UTC (permalink / raw)
  To: binutils

	PR 29254
	* stabs.c (stab_demangle_v3_arg): Free dt on failure path.

diff --git a/binutils/stabs.c b/binutils/stabs.c
index 2b5241637c1..796ff85b86a 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);
       }

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-17 11:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-17 11:57 PR29254, memory leak in stab_demangle_v3_arg 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).