diff options
-rw-r--r-- | tests/catalog.c | 18 | ||||
-rw-r--r-- | tests/util.c | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/tests/catalog.c b/tests/catalog.c index 386516e..4464fbe 100644 --- a/tests/catalog.c +++ b/tests/catalog.c @@ -145,10 +145,10 @@ test_s_print_msgs(void) { rc = 0; out: - if (str) { - free(str); + if (str != NULL) { + freeit((void *)&str); } - if (file) { + if (file != NULL) { if (fclose(file)) { logerr("fclose(): %s", strerror(errno)); rc = -1; @@ -183,10 +183,10 @@ test_s(void) { rc = 0; out: - if (str) { - free(str); + if (str != NULL) { + freeit((void *)&str); } - if (file) { + if (file != NULL) { if (fclose(file)) { logerr("fclose(): %s", strerror(errno)); rc = -1; @@ -263,10 +263,10 @@ test_s_print_msg(void) { rc = 0; out: - if (str) { - free(str); + if (str != NULL) { + freeit((void *)&str); } - if (file) { + if (file != NULL) { if (fclose(file)) { logerr("fclose(): %s", strerror(errno)); rc = -1; diff --git a/tests/util.c b/tests/util.c index cba64cf..bc85b70 100644 --- a/tests/util.c +++ b/tests/util.c @@ -96,10 +96,10 @@ test_slurp(void) { rc = 0; out: if (expected != NULL) { - free(expected); + freeit((void *)expected); } if (given != NULL) { - free(given); + freeit((void *)&given); } return rc; } |