X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=binutils%2Fstrings.c;h=3eed63adad544b39b174f89b00eefc6e73f18806;hb=bcef180ccbeb8a6a9301065ede1fe038c3040fa5;hp=00cfb6dc66963c76d67b98bd9464b861ca0162b1;hpb=ee2fb9eb60f34103739b42fbc70431cb6cdf141e;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/strings.c b/binutils/strings.c index 00cfb6dc66..3eed63adad 100644 --- a/binutils/strings.c +++ b/binutils/strings.c @@ -1,6 +1,6 @@ /* strings -- print the strings of printable characters in files Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -65,7 +65,6 @@ #include "getopt.h" #include "libiberty.h" #include "safe-ctype.h" -#include #include "bucomm.h" #define STRING_ISGRAPHIC(c) \ @@ -549,7 +548,10 @@ print_strings (const char *filename, FILE *stream, file_ptr address, { 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 +640,7 @@ print_strings (const char *filename, FILE *stream, file_ptr address, putchar ('\n'); } + free (buf); } static void