aboutsummaryrefslogtreecommitdiff
path: root/src/random.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/random.cpp')
-rw-r--r--src/random.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/random.cpp b/src/random.cpp
index 1ee6158e4b..3226abb69e 100644
--- a/src/random.cpp
+++ b/src/random.cpp
@@ -186,6 +186,7 @@ void GetDevURandom(unsigned char *ent32)
do {
ssize_t n = read(f, ent32 + have, NUM_OS_RANDOM_BYTES - have);
if (n <= 0 || n + have > NUM_OS_RANDOM_BYTES) {
+ close(f);
RandFailure();
}
have += n;