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]

Re: [RFA/gas] stabs.c (stabs_generate_asm_file): Free malloced 'dir'.


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


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