public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PR29262, memory leak in pr_function_type
@ 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: binutils

	PR 29262
	* prdbg.c (pr_function_type): Free "s" on failure path.

diff --git a/binutils/prdbg.c b/binutils/prdbg.c
index c1e41628d26..bb42a5b6c2d 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.  */

-- 
Alan Modra
Australia Development Lab, IBM

^ 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 PR29262, memory leak in pr_function_type 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).