From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3469 invoked by alias); 23 Jan 2009 17:42:28 -0000 Received: (qmail 3457 invoked by uid 22791); 23 Jan 2009 17:42:28 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Jan 2009 17:42:23 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 428101072C; Fri, 23 Jan 2009 17:42:21 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 3137B10576; Fri, 23 Jan 2009 17:42:21 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1LQQ2u-0001pB-Ig; Fri, 23 Jan 2009 12:42:20 -0500 Date: Fri, 23 Jan 2009 17:42:00 -0000 From: Daniel Jacobowitz To: Jerome Guitton Cc: Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: Add support for --with-system-gdbinit Message-ID: <20090123174220.GA6643@caradoc.them.org> Mail-Followup-To: Jerome Guitton , Eli Zaretskii , gdb-patches@sourceware.org References: <20090114135619.GA24456@caradoc.them.org> <20090114194922.GA13339@caradoc.them.org> <20090119141053.GE45099@adacore.com> <20090121105348.GD148@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090121105348.GD148@adacore.com> User-Agent: Mutt/1.5.17 (2008-05-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: 2009-01/txt/msg00471.txt.bz2 On Wed, Jan 21, 2009 at 11:53:48AM +0100, Jerome Guitton wrote: > + if (!initialized) > + { > + struct stat homebuf, cwdbuf, s; > + char *homedir, *relocated_sysgdbinit; > + > + if (stat (SYSTEM_GDBINIT, &s) == 0) > + sysgdbinit = SYSTEM_GDBINIT; What, if anything, does SYSTEM_GDBINIT get defined to when GDB is configured with no special options? > + if (homedir) > + { > + homeinit = xstrprintf ("%s/%s", homedir, gdbinit); > + if (stat (homeinit, &homebuf) != 0) > + homeinit = NULL; > + > + stat (homeinit, &homebuf); > + } You've got a bunch of memory leaks in this function; this is one of them. homeinit is not freed if it does not exist. -- Daniel Jacobowitz CodeSourcery