From: Lennart Poettering Date: Thu, 30 Apr 2020 11:20:23 +0000 (+0200) Subject: calendarspec: minor simplification X-Git-Tag: v246-rc1~442^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=05851cb9df1305d53b99f1a0ee9d2acb7e1ffb52;p=thirdparty%2Fsystemd.git calendarspec: minor simplification --- diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c index 65afcd05819..084965e64e7 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; }