public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [RFA] strings.c (print_strings): Plug memory leak.
@ 2011-03-08 20:03 Michael Snyder
  2011-03-25 17:09 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Snyder @ 2011-03-08 20:03 UTC (permalink / raw)
  To: binutils

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

OK?


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

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

	* strings.c (print_strings): Plug memory leak.

Index: strings.c
===================================================================
RCS file: /cvs/src/src/binutils/strings.c,v
retrieving revision 1.47
diff -u -p -r1.47 strings.c
--- strings.c	11 Nov 2009 04:54:32 -0000	1.47
+++ strings.c	8 Mar 2011 19:37:44 -0000
@@ -549,7 +549,10 @@ print_strings (const char *filename, FIL
 	{
 	  c = get_char (stream, &address, &magiccount, &magic);
 	  if (c == EOF)
-	    return;
+	    {
+	      free (buf);
+	      return;
+	    }
 	  if (! STRING_ISGRAPHIC (c))
 	    /* Found a non-graphic.  Try again starting with next char.  */
 	    goto tryline;
@@ -638,6 +641,7 @@ print_strings (const char *filename, FIL
 
       putchar ('\n');
     }
+  free (buf);
 }
 \f
 static void

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

* Re: [RFA] strings.c (print_strings): Plug memory leak.
  2011-03-08 20:03 [RFA] strings.c (print_strings): Plug memory leak Michael Snyder
@ 2011-03-25 17:09 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2011-03-25 17:09 UTC (permalink / raw)
  To: Michael Snyder; +Cc: binutils

Hi Michael,

> 2011-03-08  Michael Snyder<msnyder@vmware.com>
>
> 	* strings.c (print_strings): Plug memory leak.

Approved and applied.

Cheers
   Nick

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-08 20:03 [RFA] strings.c (print_strings): Plug memory leak Michael Snyder
2011-03-25 17:09 ` 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).