summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-25 20:54:24 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-25 20:54:24 +0000
commit8d8d8871ce30be7585477ab2cb4f12d2a401009e (patch)
treeaaaf05cb624b10df6dd6e6296e5e5ebe21b7cf4f /util/libreboot-utils/lib
parent0f66f08632f0a4d05a23fcdde60400943d56cf28 (diff)
lbutils: close fd on rset failure
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib')
-rw-r--r--util/libreboot-utils/lib/rand.c4
1 files changed, 4 insertions, 0 deletions
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);