test-clock: fix FILE* leak
authorMartin Pitt <martin.pitt@ubuntu.com>
Mon, 29 Feb 2016 16:40:08 +0000 (17:40 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Mon, 29 Feb 2016 16:40:08 +0000 (17:40 +0100)
Close the FILE* instead of the underlying fd.

src/test/test-clock.c

index 0949793..84f775e 100644 (file)
@@ -28,8 +28,8 @@
 
 static void test_clock_is_localtime(void) {
         char adjtime[] = "/tmp/test-adjtime.XXXXXX";
-        _cleanup_close_ int fd = -1;
-        FILE* f;
+        int fd = -1;
+        _cleanup_fclose_ FILE* f = NULL;
 
         static const struct scenario {
                 const char* contents;