diff --git a/src/output.c b/src/output.c index 2264dfed..ae2f7236 100644 --- a/src/output.c +++ b/src/output.c @@ -112,9 +112,10 @@ static void write_gitinore(const char *p) return; } FILE *gitinore = fopen(filename, "w"); - fprintf(gitinore, "*"); - - fclose(gitinore); + if (gitinore != NULL) { + fprintf(gitinore, "*"); + fclose(gitinore); + } free(filename); }