From 8d8d8871ce30be7585477ab2cb4f12d2a401009e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 25 Mar 2026 20:54:24 +0000 Subject: lbutils: close fd on rset failure Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/rand.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util/libreboot-utils') 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); -- cgit v1.2.1