This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFA/gas] stabs.c (stabs_generate_asm_file): Free malloced 'dir'.
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: Michael Snyder <msnyder at vmware dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>, "rth at redhat dot com" <rth at redhat dot com>
- Date: Thu, 10 Mar 2011 11:50:58 -0800
- Subject: Re: [RFA/gas] stabs.c (stabs_generate_asm_file): Free malloced 'dir'.
- References: <201103101731.p2AHVob22846@lucas.cup.hp.com> <4D791823.10807@vmware.com>
- Reply-to: sje at cup dot hp dot com
On Thu, 2011-03-10 at 10:27 -0800, Michael Snyder wrote:
> Thanks for the excellent analysis.
>
> However, I never checked in the change you are referring to.
> Are you sure you're not thinking of the similar change that I
> checked in to dwarf2dbg.c?
Yes, the change to dwarf2dbg.c is what I was refering too. Looks like
I got confused and followed up to the wrong email. The problem
started with this patch:
2011-03-09 Michael Snyder <msnyder@vmware.com>
* dwarf2dbg.c (out_file_list): Free malloced 'dir'.
(out_debug_info): Free malloced 'dirname' and 'comp_dir'.
(emit_fixed_inc_line_addr): Assign instead of conditional
in assert.
I am thinking the best fix might be this change to remap_debug_filename
so that it always allocates the return value and can thus that value can
always be freed.
Index: remap.c
===================================================================
RCS file: /cvs/src/src/gas/remap.c,v
retrieving revision 1.3
diff -r1.3 remap.c
83c83
< return filename;
---
> return xstrdup (filename);
It seems to fix my GCC build.
Steve Ellcey
sje@cup.hp.com