This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH RFA: libcpp speedup patch: avoid opening nonexistent files


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]