diff --git a/util/libreboot-utils/lib/rand.c b/util/libreboot-utils/lib/rand.c index 7b53b6a4..31221d61 100644 --- a/util/libreboot-utils/lib/rand.c +++ b/util/libreboot-utils/lib/rand.c @@ -128,6 +128,10 @@ out: errno = saved_errno; return; err: +#if defined(USE_URANDOM) && \ + ((USE_URANDOM) > 0) + close_no_err(&fd); +#endif err_no_cleanup(0, ECANCELED, "Randomisation failure, possibly unsupported in your kernel"); exit(EXIT_FAILURE);