]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Don't fclose() twice (CID #1506722) (#4593)
authorJames Jones <jejones3141@gmail.com>
Thu, 30 Jun 2022 19:00:14 +0000 (14:00 -0500)
committerGitHub <noreply@github.com>
Thu, 30 Jun 2022 19:00:14 +0000 (15:00 -0400)
The globally-writable directory case goes to perm_error,
which fclose()s fp. No need to do it twice.

src/lib/util/dict_tokenize.c

index f1aa70becc9714a0343caf6a5715fde7059f751d..9c1ee2cf2471bbc1dc50e1f530d50fa7ea7d8d15 100644 (file)
@@ -1920,7 +1920,6 @@ static int _dict_from_file(dict_tokenize_ctx_t *ctx,
         */
 #ifdef S_IWOTH
        if (dict_gctx->perm_check && ((statbuf.st_mode & S_IWOTH) != 0)) {
-               fclose(fp);
                fr_strerror_printf_push("Dictionary is globally writable: %s. "
                                        "Refusing to start due to insecure configuration", fn);
                goto perm_error;