summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binutils/ChangeLog2
-rw-r--r--binutils/wrstabs.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 2ec667f089..5172026208 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,7 @@
2011-03-14 Michael Snyder <msnyder@vmware.com>
+ * wrstabs.c (stab_start_struct_type): Close memory leak.
+
* readelf.c (process_version_sections): Free symbols.
* nm.c (display_rel_file): Free symsizes.
diff --git a/binutils/wrstabs.c b/binutils/wrstabs.c
index 0ca861ce8d..bbf257e5f5 100644
--- a/binutils/wrstabs.c
+++ b/binutils/wrstabs.c
@@ -1312,9 +1312,7 @@ stab_start_struct_type (void *p, const char *tag, unsigned int id,
struct stab_write_handle *info = (struct stab_write_handle *) p;
long tindex;
bfd_boolean definition;
- char *buf;
-
- buf = (char *) xmalloc (40);
+ char buf[40];
if (id == 0)
{