aboutsummaryrefslogtreecommitdiff
path: root/tests/test_ini.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-09-30 12:40:16 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-09-30 12:40:16 -0400
commit239926d9b58b72a9dd86b85ba569c5fc61a479c2 (patch)
treee3e28db10f5b0f5241b7217bcc947bb5d23a1937 /tests/test_ini.c
parent3881ec0a37f9880d6e602a8205b0fb2bd4d54b4f (diff)
downloadstasis-239926d9b58b72a9dd86b85ba569c5fc61a479c2.tar.gz
Fix leaks in tests
Diffstat (limited to 'tests/test_ini.c')
-rw-r--r--tests/test_ini.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_ini.c b/tests/test_ini.c
index 2579e21..e4a7808 100644
--- a/tests/test_ini.c
+++ b/tests/test_ini.c
@@ -86,11 +86,13 @@ void test_ini_setval_getval() {
STASIS_ASSERT(ini_getval(ini, "default", "a", INIVAL_TYPE_STR, render_mode, &val) == 0, "failed to get value");
STASIS_ASSERT(strcmp(val.as_char_p, "a") != 0, "unexpected value loaded from modified variable");
STASIS_ASSERT(strcmp(val.as_char_p, "changed") == 0, "unexpected value loaded from modified variable");
+ guard_free(val.as_char_p);
STASIS_ASSERT(ini_setval(&ini, INI_SETVAL_APPEND, "default", "a", " twice") == 0, "failed to set value");
STASIS_ASSERT(ini_getval(ini, "default", "a", INIVAL_TYPE_STR, render_mode, &val) == 0, "failed to get value");
STASIS_ASSERT(strcmp(val.as_char_p, "changed") != 0, "unexpected value loaded from modified variable");
STASIS_ASSERT(strcmp(val.as_char_p, "changed twice") == 0, "unexpected value loaded from modified variable");
+ guard_free(val.as_char_p);
ini_free(&ini);
remove(filename);
}