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]

[RFA] dwarf.c (display_debug_frames): Free allocated memory.


OK?

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

	* dwarf.c (display_debug_frames): Free allocated memory.

Index: dwarf.c
===================================================================
RCS file: /cvs/src/src/binutils/dwarf.c,v
retrieving revision 1.84
diff -u -p -r1.84 dwarf.c
--- dwarf.c	23 Feb 2011 08:52:33 -0000	1.84
+++ dwarf.c	8 Mar 2011 21:39:52 -0000
@@ -4127,6 +4127,7 @@ display_debug_frames (struct dwarf_secti
   int max_regs = 0;
   const char *bad_reg = _("bad register: ");
   int saved_eh_addr_size = eh_addr_size;
+  Frame_Chunk *fc = NULL;
 
   printf (_("Contents of the %s section:\n"), section->name);
 
@@ -4136,7 +4137,6 @@ display_debug_frames (struct dwarf_secti
       unsigned char *block_end;
       unsigned long length;
       unsigned long cie_id;
-      Frame_Chunk *fc;
       Frame_Chunk *cie;
       int need_col_headers = 1;
       unsigned char *augmentation_data = NULL;
@@ -4181,6 +4181,7 @@ display_debug_frames (struct dwarf_secti
 	{
 	  int version;
 
+	  free (fc);
 	  fc = (Frame_Chunk *) xmalloc (sizeof (Frame_Chunk));
 	  memset (fc, 0, sizeof (Frame_Chunk));
 
@@ -4913,7 +4914,7 @@ display_debug_frames (struct dwarf_secti
     }
 
   printf ("\n");
-
+  free (fc);
   return 1;
 }
 

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