On Wed, Jan 22, 2014 at 09:16:02AM +0100, Dodji Seketeli wrote:
> +static fcache*
> +add_file_to_cache_tab (const char *file_path)
> +{
> +
> +  FILE *fp = fopen (file_path, "r");
> +  if (ferror (fp))
> +    {
> +      fclose (fp);
> +      return NULL;
> +    }

I've seen various segfaults here when playing with preprocessed sources
from PRs (obviously don't have the original source files).
When fopen fails, it just returns NULL, so I don't see why you just don't
do
  if (fp == NULL)
    return fp;

        Jakub

Reply via email to