From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11756 invoked by alias); 13 Sep 2008 22:35:42 -0000 Received: (qmail 11747 invoked by uid 22791); 13 Sep 2008 22:35:42 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 13 Sep 2008 22:34:59 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 06BE42A96CB; Sat, 13 Sep 2008 18:34:58 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lDsyuJw55hVj; Sat, 13 Sep 2008 18:34:57 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id BDF672A96C9; Sat, 13 Sep 2008 18:34:57 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 59ED5E7ACD; Sat, 13 Sep 2008 15:34:55 -0700 (PDT) Date: Sat, 13 Sep 2008 22:35:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFA: fix minor memory leak in symfile.c Message-ID: <20080913223455.GB19625@adacore.com> References: <20080913171723.GH3714@adacore.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i 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-09/txt/msg00301.txt.bz2 > So, I think this probably isn't worth pursuing. I agree. > I did find a few stray uses of free. I can send that patch if you > like. I'm not even sure if this matters -- I suppose the > justification for xfree is not as strong as that for xmalloc. Yes, in practice xfree doesn't do anything more than free. I looked at the code, and it only contains a check against NULL, right now. The C standard requires that free does nothing when passed a NULL pointer. So unless we're building GDB with a screwy C compiler, it's strictly equivalent to calling free. Still, I think it'd be nice to get rid of these. In desperate situations, one might want to locally hack these to track memory issues... -- Joel