]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
it's good to close files we've opened..
authorAlan T. DeKok <aland@freeradius.org>
Sun, 5 Feb 2017 14:53:33 +0000 (09:53 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 5 Feb 2017 14:53:59 +0000 (09:53 -0500)
src/main/conffile.c

index d99b2f721b50ca97f26f05e29a90787393e8a944..da78700876948b1f85ca82906138059d685cc183 100644 (file)
@@ -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;
-
 }