]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
calendarspec: minor simplification
authorLennart Poettering <lennart@poettering.net>
Thu, 30 Apr 2020 11:20:23 +0000 (13:20 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 5 May 2020 06:57:14 +0000 (08:57 +0200)
src/shared/calendarspec.c

index 65afcd058194733b2104fcef0124d578dab38055..084965e64e7b89727b320a4e875013fd1d5c5939 100644 (file)
@@ -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;
 }