aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-04-26 01:49:02 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-04-26 01:49:02 -0400
commit421903a1379353f07a10deb335ed3c0361233064 (patch)
tree3219db1cff5ea3eaede98dcdfeda32cdc5ca70ef /tests
parentd2892e347a619325550fa45cb8da5914bf2a5343 (diff)
downloadstasis-421903a1379353f07a10deb335ed3c0361233064.tar.gz
Fix file handle leaks
Diffstat (limited to 'tests')
-rw-r--r--tests/test_relocation.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test_relocation.c b/tests/test_relocation.c
index 3454a69..4a02e01 100644
--- a/tests/test_relocation.c
+++ b/tests/test_relocation.c
@@ -40,6 +40,7 @@ void test_file_replace_text() {
STASIS_ASSERT(file_replace_text(filename, target, "^^^", 0) == 0, "string replacement failed");
} else {
STASIS_ASSERT(false, "failed to open file for writing");
+ fclose(fp);
return;
}
@@ -48,8 +49,10 @@ void test_file_replace_text() {
if (fp) {
fread(input, sizeof(*input), sizeof(input), fp);
STASIS_ASSERT(strcmp(input, expected) == 0, "unexpected replacement");
+ fclose(fp);
} else {
STASIS_ASSERT(false, "failed to open file for reading");
+ fclose(fp);
return;
}
}