public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [RFA] ieee.c, plug several memory leaks.
@ 2011-03-08 21:07 Michael Snyder
  2011-03-25 17:22 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Snyder @ 2011-03-08 21:07 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 5 bytes --]

OK?


[-- Attachment #2: ieee.txt --]
[-- Type: text/plain, Size: 1693 bytes --]

2011-03-08  Michael Snyder  <msnyder@msnyder-server.eng.vmware.com>

	* ieee.c (ieee_add_bb11): Plug memory leak.
	(ieee_function_type): Ditto.
	(ieee_class_baseclass): Ditto.

Index: ieee.c
===================================================================
RCS file: /cvs/src/src/binutils/ieee.c,v
retrieving revision 1.28
diff -u -p -r1.28 ieee.c
--- ieee.c	28 Feb 2011 18:32:51 -0000	1.28
+++ ieee.c	8 Mar 2011 21:05:01 -0000
@@ -5125,7 +5125,10 @@ ieee_add_bb11 (struct ieee_handle *info,
 	  || ! ieee_write_id (info, "")
 	  || ! ieee_write_number (info, 0)
 	  || ! ieee_write_id (info, "GNU objcopy"))
-	return FALSE;
+	{
+	  free (c);
+	  return FALSE;
+	}
 
       free (c);
     }
@@ -5529,7 +5532,10 @@ ieee_function_type (void *p, int argcoun
       || ! ieee_write_number (info, 0)
       || ! ieee_write_number (info, retindx)
       || ! ieee_write_number (info, (bfd_vma) argcount + (varargs ? 1 : 0)))
-    return FALSE;
+    {
+      free (args);
+      return FALSE;
+    }
   if (argcount > 0)
     {
       for (i = 0; i < argcount; i++)
@@ -6235,7 +6241,10 @@ ieee_class_baseclass (void *p, bfd_vma b
 	  || ! ieee_write_id (info, fname)
 	  || ! ieee_write_number (info, bindx)
 	  || ! ieee_write_number (info, bitpos / 8))
-	return FALSE;
+	{
+	  free (fname);
+	  return FALSE;
+	}
       flags = 0;
     }
 
@@ -6250,7 +6259,10 @@ ieee_class_baseclass (void *p, bfd_vma b
       || ! ieee_write_atn65 (info, nindx, bname)
       || ! ieee_write_asn (info, nindx, 0)
       || ! ieee_write_atn65 (info, nindx, fname))
-    return FALSE;
+    {
+      free (fname);
+      return FALSE;
+    }
   info->type_stack->type.classdef->pmisccount += 5;
 
   free (fname);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFA] ieee.c, plug several memory leaks.
  2011-03-08 21:07 [RFA] ieee.c, plug several memory leaks Michael Snyder
@ 2011-03-25 17:22 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2011-03-25 17:22 UTC (permalink / raw)
  To: Michael Snyder; +Cc: binutils

Hi Michael,

> 2011-03-08  Michael Snyder<msnyder@msnyder-server.eng.vmware.com>
>
> 	* ieee.c (ieee_add_bb11): Plug memory leak.
> 	(ieee_function_type): Ditto.
> 	(ieee_class_baseclass): Ditto.

Approved and applied.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-25 17:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-08 21:07 [RFA] ieee.c, plug several memory leaks Michael Snyder
2011-03-25 17:22 ` Nick Clifton

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).