chiark / gitweb /
systemctl: fix a FILE* leak
authorMichal Schmidt <mschmidt@redhat.com>
Mon, 13 Jun 2011 12:19:53 +0000 (14:19 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 14 Jun 2011 19:59:14 +0000 (21:59 +0200)
In practice it does not really matter, but let's be nice and close the
file.

src/systemctl.c

index 889e3ee0641fb47e058d500612897974b6286ace..2bd173c5d0216699363b77776a8f4273db01d45c 100644 (file)
@@ -4172,8 +4172,10 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo
         if (streq(verb, "is-enabled") &&
             strv_isempty(i->aliases) &&
             strv_isempty(i->wanted_by) &&
-            !path_startswith(filename, "/etc"))
+            !path_startswith(filename, "/etc")) {
+                fclose(f);
                 return 1;
+        }
 
         n_symlinks += strv_length(i->aliases);
         n_symlinks += strv_length(i->wanted_by);