From: James Jones Date: Thu, 30 Jun 2022 19:00:14 +0000 (-0500) Subject: Don't fclose() twice (CID #1506722) (#4593) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e459519531fd0caf6071108cac489af8b580a93;p=thirdparty%2Ffreeradius-server.git Don't fclose() twice (CID #1506722) (#4593) The globally-writable directory case goes to perm_error, which fclose()s fp. No need to do it twice. --- diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index f1aa70becc9..9c1ee2cf247 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -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;