diff options
author | Andy Polyakov <appro@openssl.org> | 2018-04-01 18:18:46 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2018-04-04 20:27:59 +0200 |
commit | b791355b5c0c474ba1005008e3731a859de0754d (patch) | |
tree | 2a52812e3623782b928a2e24d16a9dccc2ed2005 /crypto/rand | |
parent | 6228b1dae265bbe6c46457d82b2d14d672af5f46 (diff) | |
download | openssl-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.c | 1 |
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; } |