]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
close FD on one more path, too
authorAlan T. DeKok <aland@freeradius.org>
Sun, 5 Feb 2017 16:16:35 +0000 (11:16 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 5 Feb 2017 18:17:34 +0000 (13:17 -0500)
src/main/conffile.c

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