This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[RFA] dwarf.c (display_debug_frames): Free allocated memory.
- From: Michael Snyder <msnyder at vmware dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Tue, 08 Mar 2011 13:41:45 -0800
- Subject: [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;
}