diff --git a/src/crypto/random.c b/src/crypto/random.c index f545917a7..7f5c08a6d 100644 --- a/src/crypto/random.c +++ b/src/crypto/random.c @@ -358,7 +358,8 @@ static void random_write_entropy(void) if (!random_entropy_file) return; - random_get_bytes(buf, RANDOM_ENTROPY_SIZE); + if (random_get_bytes(buf, RANDOM_ENTROPY_SIZE) < 0) + return; f = fopen(random_entropy_file, "wb"); if (f == NULL) {