From: Alan T. DeKok Date: Sun, 5 Feb 2017 14:53:33 +0000 (-0500) Subject: it's good to close files we've opened.. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65713a09de6f366b68904469e2636929d3e57aa7;p=thirdparty%2Ffreeradius-server.git it's good to close files we've opened.. --- diff --git a/src/main/conffile.c b/src/main/conffile.c index d99b2f721b5..da787008769 100644 --- a/src/main/conffile.c +++ b/src/main/conffile.c @@ -494,6 +494,8 @@ static bool cf_file_check(CONF_SECTION *cs, char const *filename, bool check_per if (fd < 0) goto perm_error; if (fstat(fd, &file->buf) < 0) goto perm_error; + close(fd); + #ifdef S_IWOTH if ((file->buf.st_mode & S_IWOTH) != 0) { ERROR("Configuration file %s is globally writable. " @@ -509,7 +511,6 @@ static bool cf_file_check(CONF_SECTION *cs, char const *filename, bool check_per if (!rbtree_insert(tree, file)) talloc_free(file); return true; - }