summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/shared/calendarspec.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c
index 65afcd0581..084965e64e 100644
--- a/src/shared/calendarspec.c
+++ b/src/shared/calendarspec.c
@@ -369,14 +369,13 @@ int calendar_spec_to_string(const CalendarSpec *c, char **p) {
}
r = fflush_and_check(f);
+ fclose(f);
+
if (r < 0) {
free(buf);
- fclose(f);
return r;
}
- fclose(f);
-
*p = buf;
return 0;
}