From a20cf9d20b2dc2e4fc3374c76709000d5086a68c Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 14 Jun 2011 10:26:32 +0200 Subject: [PATCH] install: don't leak a FILE object for unit files in /lib or /usr... * src/systemctl.c: Don't leak a FILE for unit files in /lib or /usr that lack [Install] data. --- src/systemctl.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/systemctl.c b/src/systemctl.c index faca797..2f1df03 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -4165,8 +4165,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; + } i->path = filename; -- 1.7.6.rc0.293.g40857