aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-04-22 12:08:40 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-04-22 12:08:40 -0400
commit58102ac5a1d8daa16aa623a4ea900a3d1e603947 (patch)
treef2b99632ffbc859f865ba9f3ae8e3554ab0f2919
parentfff9d1997f7a1094c8c5ede672d750643bd08d01 (diff)
downloadstasis-58102ac5a1d8daa16aa623a4ea900a3d1e603947.tar.gz
test_file_readlines: close handle on error
-rw-r--r--tests/test_utils.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/test_utils.c b/tests/test_utils.c
index 7361139..a5faf5c 100644
--- a/tests/test_utils.c
+++ b/tests/test_utils.c
@@ -279,6 +279,7 @@ void test_file_readlines() {
}
if (fwrite(data, sizeof(*data), strlen(data), fp) != strlen(data)) {
perror("short write");
+ fclose(fp);
return;
}
fclose(fp);