diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-02-04 11:43:57 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-02-04 11:43:57 -0500 |
commit | 41750cc2cbe10ebb6700536e2040272747f22b7c (patch) | |
tree | 9294ab94dc0e762421e3532008d3e37fba5459aa /tests | |
parent | e8811a2936245718cfe2a833999508dc2a1bf6fc (diff) | |
download | stasis-41750cc2cbe10ebb6700536e2040272747f22b7c.tar.gz |
test_system.c: free allocated resources
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_system.c | 3 |
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() { |