projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6228b1d
)
rand/randfile.c: fix potential resource leak in RAND_load_file.
author
Andy Polyakov
<appro@openssl.org>
Sun, 1 Apr 2018 16:18:46 +0000
(18:18 +0200)
committer
Andy Polyakov
<appro@openssl.org>
Wed, 4 Apr 2018 18:27:59 +0000
(20:27 +0200)
Found by Coverity.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5834)
crypto/rand/randfile.c
patch
|
blob
|
history
diff --git
a/crypto/rand/randfile.c
b/crypto/rand/randfile.c
index 3a62b88cf07a0cbfcdb137aa800d0d6ef2cb06dc..c652ddcf1e6c08224e7589600a24eab169158d4f 100644
(file)
--- 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;
}