From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16916 invoked by alias); 28 Jun 2007 22:48:50 -0000 Received: (qmail 16908 invoked by uid 22791); 28 Jun 2007 22:48:50 -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, 28 Jun 2007 22:48:47 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 7D9BE982A2; Thu, 28 Jun 2007 22:48:46 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 5C86D9817E; Thu, 28 Jun 2007 22:48:46 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1I42md-0003MU-Rj; Thu, 28 Jun 2007 18:48:15 -0400 Date: Thu, 28 Jun 2007 22:49:00 -0000 From: Daniel Jacobowitz To: msnyder@sonic.net Cc: gdb-patches@sourceware.org Subject: Re: [OB] Add cleanup, source.c Message-ID: <20070628224815.GC12578@caradoc.them.org> Mail-Followup-To: msnyder@sonic.net, gdb-patches@sourceware.org References: <9270.12.7.175.2.1183069663.squirrel@webmail.sonic.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9270.12.7.175.2.1183069663.squirrel@webmail.sonic.net> User-Agent: Mutt/1.5.15 (2007-04-09) 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: 2007-06/txt/msg00506.txt.bz2 On Thu, Jun 28, 2007 at 03:27:43PM -0700, msnyder@sonic.net wrote: > A missed opportunity for cleanup, flagged by Coverity. > > I'm cut'and'pasting the patch to avoid my browser turning it into a > binary stream. This may eliminate tabs, but I don't expect anybody > to actually apply this with 'patch'... > > 2007-06-28 Michael Snyder > > * source.c (unset_substitute_path_command): Plug leak (Coverity). I think you need to do these a little slower... > /* This function takes either 0 or 1 argument. */ > > + make_cleanup_freeargv (argv); > if (argv != NULL && argv[0] != NULL && argv[1] != NULL) > error (_("Incorrect usage, too many arguments in command")); There's no call to do_cleanups in this function, so it's quite hard to see if this cleanup will be run or discarded if error is not called. -- Daniel Jacobowitz CodeSourcery