This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Commit: Fix memory leak in chew


Hi Guys,

  I am applying the patch below to close a memory leak in the chew
  program.  Doing so allows me to compile the binutils with
  -fsanitize=address enabled.

Cheers
  Nick

bfd/ChangeLog
2016-08-22  Nick Clifton  <nickc@redhat.com>

	* doc/chew.c (main): Free the string buffer used to files as they
	are parsed.
  
diff --git a/bfd/doc/chew.c b/bfd/doc/chew.c
index 71c7e2d..bf3d249 100644
--- a/bfd/doc/chew.c
+++ b/bfd/doc/chew.c
@@ -1602,6 +1602,7 @@ main (ac, av)
 	      read_in (&b, f);
 	      compile (b.ptr);
 	      perform ();
+	      delete_string (&b);
 	    }
 	  else if (av[i][1] == 'i')
 	    {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]