From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23961 invoked by alias); 8 Jan 2007 18:51:11 -0000 Received: (qmail 23947 invoked by uid 22791); 8 Jan 2007 18:51:11 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 08 Jan 2007 18:51:06 +0000 Received: from zps76.corp.google.com (zps76.corp.google.com [172.25.146.76]) by smtp-out.google.com with ESMTP id l08Ip03K002334; Mon, 8 Jan 2007 10:51:00 -0800 Received: from dhcp-172-18-118-195.corp.google.com.google.com (dhcp-172-18-118-195.corp.google.com [172.18.118.195]) (authenticated bits=0) by zps76.corp.google.com with ESMTP id l08Ioig2011646 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 8 Jan 2007 10:50:44 -0800 To: Ralf Wildenhues Cc: gcc-patches@gcc.gnu.org Subject: Re: PATCH RFA: libcpp speedup patch: avoid opening nonexistent files References: <20070108184613.GH4311@iam.uni-bonn.de> From: Ian Lance Taylor Date: Mon, 08 Jan 2007 18:51:00 -0000 In-Reply-To: <20070108184613.GH4311@iam.uni-bonn.de> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-01/txt/msg00597.txt.bz2 Ralf Wildenhues writes: > > @@ -322,6 +323,16 @@ find_file_in_dir (cpp_reader *pfile, _cp > > > > if (path) > > { > > + hashval_t hv = htab_hash_string (path); > > + char *copy; > > + void **pp; > > + > > + if (htab_find_with_hash (pfile->nonexistent_file_hash, path, hv) != NULL) > > + { > > + file->err_no = ENOENT; > > + return false; > > ... aren't you leaking 'path' here? You're right, thanks for pointing that out. I'll fix that up. Ian