aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/rand
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2018-04-01 18:18:46 +0200
committerAndy Polyakov <appro@openssl.org>2018-04-04 20:27:59 +0200
commitb791355b5c0c474ba1005008e3731a859de0754d (patch)
tree2a52812e3623782b928a2e24d16a9dccc2ed2005 /crypto/rand
parent6228b1dae265bbe6c46457d82b2d14d672af5f46 (diff)
downloadopenssl-b791355b5c0c474ba1005008e3731a859de0754d.tar.gz
rand/randfile.c: fix potential resource leak in RAND_load_file.
Found by Coverity. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5834)
Diffstat (limited to 'crypto/rand')
-rw-r--r--crypto/rand/randfile.c1
1 files changed, 1 insertions, 0 deletions
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;
}