aboutsummaryrefslogtreecommitdiff
path: root/tests/test_errors.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_errors.c')
-rw-r--r--tests/test_errors.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_errors.c b/tests/test_errors.c
index 82241ed..18c444e 100644
--- a/tests/test_errors.c
+++ b/tests/test_errors.c
@@ -6,6 +6,8 @@ int main() {
path = NULL;
//intentionally bad
- myassert(cleanpath_init("good", NULL) == NULL, "cleanpath_init() returned non-NULL on NULL sep\n");
- myassert(cleanpath_init(NULL, "good") == NULL, "cleanpath_init() returned non-NULL on NULL path\n");
+ myassert((path = cleanpath_init("good", NULL)) == NULL, "cleanpath_init() returned non-NULL on NULL sep\n");
+ if (path) cleanpath_free(path);
+ myassert((path = cleanpath_init(NULL, "good")) == NULL, "cleanpath_init() returned non-NULL on NULL path\n");
+ if (path) cleanpath_free(path);
}