This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFA: libcpp speedup patch: avoid opening nonexistent files
- From: Ian Lance Taylor <iant at google dot com>
- To: Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 08 Jan 2007 10:50:41 -0800
- Subject: Re: PATCH RFA: libcpp speedup patch: avoid opening nonexistent files
- References: <m3vejvtymj.fsf@localhost.localdomain> <20070108184613.GH4311@iam.uni-bonn.de>
Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 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