From: Alan T. DeKok Date: Sun, 5 Feb 2017 16:16:35 +0000 (-0500) Subject: close FD on one more path, too X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b1c487708552bedfd7ce593f9e966bef67e9e9f;p=thirdparty%2Ffreeradius-server.git close FD on one more path, too --- diff --git a/src/main/conffile.c b/src/main/conffile.c index da787008769..453e5ba19c7 100644 --- a/src/main/conffile.c +++ b/src/main/conffile.c @@ -428,7 +428,7 @@ static bool cf_file_check(CONF_SECTION *cs, char const *filename, bool check_per cf_file_t *file; CONF_SECTION *top; rbtree_t *tree; - int fd; + int fd = -1; top = cf_top_section(cs); tree = cf_data_find(top, rbtree_t, "filename"); @@ -446,6 +446,7 @@ static bool cf_file_check(CONF_SECTION *cs, char const *filename, bool check_per rad_file_error(errno); /* Write error and euid/egid to error buff */ ERROR("Unable to open file \"%s\": %s", filename, fr_strerror()); error: + if (fd >= 0) close(fd); talloc_free(file); return false; }