From e7978964e8ad67663e1dee9838ce0a2f5a74d886 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Mon, 14 Mar 2011 19:05:39 +0000 Subject: [PATCH] 2011-03-08 Michael Snyder * wrstabs.c (stab_start_struct_type): Close memory leak. --- binutils/ChangeLog | 2 ++ binutils/wrstabs.c | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 2ec667f08..517202620 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,7 @@ 2011-03-14 Michael Snyder + * 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 0ca861ce8..bbf257e5f 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) { -- 2.11.4.GIT