From b791355b5c0c474ba1005008e3731a859de0754d Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sun, 1 Apr 2018 18:18:46 +0200 Subject: [PATCH] rand/randfile.c: fix potential resource leak in RAND_load_file. Found by Coverity. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/5834) --- crypto/rand/randfile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index 3a62b88cf0..c652ddcf1e 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -94,6 +94,7 @@ int RAND_load_file(const char *file, long bytes) if (fstat(fileno(in), &sb) < 0) { RANDerr(RAND_F_RAND_LOAD_FILE, RAND_R_INTERNAL_ERROR); ERR_add_error_data(2, "Filename=", file); + fclose(in); return -1; } -- GitLab