aboutsummaryrefslogtreecommitdiff
path: root/tests/test_system.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2025-02-04 13:06:11 -0500
committerGitHub <noreply@github.com>2025-02-04 13:06:11 -0500
commit89bd28eb5ac263d1753021f25e1bc62f48e7008d (patch)
tree622918f9a81723b830ab8bcc403154271932b591 /tests/test_system.c
parent2372e40c40ef7bc85176d8998272ad75a59fcf05 (diff)
parent825aa472739775a5e2d673043f9d846df1eac924 (diff)
downloadstasis-89bd28eb5ac263d1753021f25e1bc62f48e7008d.tar.gz
Merge pull request #86 from jhunkeler/memfixes
ASAN: Fix leaks
Diffstat (limited to 'tests/test_system.c')
-rw-r--r--tests/test_system.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test_system.c b/tests/test_system.c
index 0f6bfb7..2271e13 100644
--- a/tests/test_system.c
+++ b/tests/test_system.c
@@ -18,6 +18,7 @@ void test_shell_output_null_args() {
result = shell_output(NULL, &status);
STASIS_ASSERT(strcmp(result, "") == 0, "no output expected");
STASIS_ASSERT(status != 0, "expected a non-zero exit code due to null argument string");
+ guard_free(result);
}
void test_shell_output_non_zero_exit() {
@@ -26,6 +27,7 @@ void test_shell_output_non_zero_exit() {
result = shell_output("HELLO1234 WORLD", &status);
STASIS_ASSERT(strcmp(result, "") == 0, "no output expected");
STASIS_ASSERT(status != 0, "expected a non-zero exit code due to intentional error");
+ guard_free(result);
}
void test_shell_output() {
@@ -34,6 +36,7 @@ void test_shell_output() {
result = shell_output("echo HELLO WORLD", &status);
STASIS_ASSERT(strcmp(result, "HELLO WORLD\n") == 0, "output message was incorrect");
STASIS_ASSERT(status == 0, "expected zero exit code");
+ guard_free(result);
}
void test_shell_safe() {