diff --git a/src/ical.c b/src/ical.c index 4a7738e2..6d2d8d28 100644 --- a/src/ical.c +++ b/src/ical.c @@ -214,7 +214,8 @@ static void ical_export_note(FILE *stream, char *name) asprintf(¬e_file, "%s/%s", path_notes, name); if (!(fp = fopen(note_file, "r")) || ungetc(getc(fp), fp) == EOF) { - fclose(fp); + if (fp) + fclose(fp); return; } string_init(¬e);