From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31958 invoked by alias); 17 Apr 2008 15:59:12 -0000 Received: (qmail 31946 invoked by uid 22791); 17 Apr 2008 15:59:11 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 17 Apr 2008 15:58:43 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 475CB983D9; Thu, 17 Apr 2008 15:58:41 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 28B6E982C4; Thu, 17 Apr 2008 15:58:41 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JmWVU-0005yj-AZ; Thu, 17 Apr 2008 11:58:40 -0400 Date: Thu, 17 Apr 2008 16:15:00 -0000 From: Daniel Jacobowitz To: Doug Evans Cc: gdb-patches@sourceware.org Subject: Re: [RFA] source.c:find_and_open_source cleanup Message-ID: <20080417155840.GD17488@caradoc.them.org> Mail-Followup-To: Doug Evans , gdb-patches@sourceware.org References: <20080407193412.3CDC11C751F@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080407193412.3CDC11C751F@localhost> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00341.txt.bz2 On Mon, Apr 07, 2008 at 12:34:12PM -0700, Doug Evans wrote: > This is odd: > > if (result >= 0) > { > char *tmp_fullname; > tmp_fullname = *fullname; > *fullname = xstrdup (tmp_fullname); > xfree (tmp_fullname); > } > > Is there something subtle going on here? > I thought maybe the caller might be expecting a newly allocated value > if it passed in a value for `fullname', but the previous value has > already been freed at this point. > > 2008-04-07 Doug Evans > > * source.c (find_and_open_source): Add some comments clarifying > handling of FULLNAME argument. Make static. Remove pointless > xstrdup/xfree. Looks good to me. Please commit, thanks! -- Daniel Jacobowitz CodeSourcery