aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-04-23 12:10:29 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-04-23 12:10:29 -0400
commit7aa05b4c4db5bca53f9ed957e4307235be844e9b (patch)
treefb42b9b8ef8bbaa5cef10bf988ce10ab58a652ba
parentbbd14eb5a44b016d6648c383bf9df96c7e8e0b7c (diff)
downloadstasis-7aa05b4c4db5bca53f9ed957e4307235be844e9b.tar.gz
Close handle on error
-rw-r--r--src/lib/core/utils.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/core/utils.c b/src/lib/core/utils.c
index 1fe9d1f..21f2297 100644
--- a/src/lib/core/utils.c
+++ b/src/lib/core/utils.c
@@ -1172,6 +1172,7 @@ int get_random_bytes(char *result, size_t maxlen) {
}
if (fp && ferror(fp)) {
SYSERROR("%s", "unable to read from random generator");
+ fclose(fp);
return -1;
}
if (isalnum(ch)) {