From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24893 invoked by alias); 10 Mar 2011 19:51:10 -0000 Received: (qmail 24884 invoked by uid 22791); 10 Mar 2011 19:51:09 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from g4t0017.houston.hp.com (HELO g4t0017.houston.hp.com) (15.201.24.20) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Mar 2011 19:51:02 +0000 Received: from g4t0018.houston.hp.com (g4t0018.houston.hp.com [16.234.32.27]) by g4t0017.houston.hp.com (Postfix) with ESMTP id 029B4385B7; Thu, 10 Mar 2011 19:51:00 +0000 (UTC) Received: from [16.89.92.85] (hpsje.cup.hp.com [16.89.92.85]) by g4t0018.houston.hp.com (Postfix) with ESMTP id A4ABB10090; Thu, 10 Mar 2011 19:50:59 +0000 (UTC) Subject: Re: [RFA/gas] stabs.c (stabs_generate_asm_file): Free malloced 'dir'. From: Steve Ellcey Reply-To: sje@cup.hp.com To: Michael Snyder Cc: "binutils@sourceware.org" , "rth@redhat.com" In-Reply-To: <4D791823.10807@vmware.com> References: <201103101731.p2AHVob22846@lucas.cup.hp.com> <4D791823.10807@vmware.com> Content-Type: text/plain; charset="UTF-8" Date: Thu, 10 Mar 2011 19:51:00 -0000 Message-ID: <1299786658.30497.218.camel@hpsje.cup.hp.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00209.txt.bz2 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 * 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