test-fileio: close two leaked file handles
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 24 Sep 2017 06:59:49 +0000 (08:59 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 24 Sep 2017 08:50:27 +0000 (10:50 +0200)
src/test/test-fileio.c

index 375b7a8..eebaa2c 100644 (file)
@@ -209,7 +209,7 @@ static void test_parse_multiline_env_file(void) {
 static void test_merge_env_file(void) {
         char t[] = "/tmp/test-fileio-XXXXXX";
         int fd, r;
-        FILE *f;
+        _cleanup_fclose_ FILE *f = NULL;
         _cleanup_strv_free_ char **a = NULL;
         char **i;
 
@@ -278,7 +278,7 @@ static void test_merge_env_file(void) {
 static void test_merge_env_file_invalid(void) {
         char t[] = "/tmp/test-fileio-XXXXXX";
         int fd, r;
-        FILE *f;
+        _cleanup_fclose_ FILE *f = NULL;
         _cleanup_strv_free_ char **a = NULL;
         char **i;