X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Funit%2Ftest_utils_expand_path.cpp;h=d11c2d9198d46605f54bab9073c1a8c7bdd03d42;hb=64803277bbdbe0a943360d918298a48157d9da55;hp=85c8a54282fc947aa7591c4476368fef62032d3b;hpb=9f4a25d35d037cbb5d8aeb50f9e8fa10748a4d14;p=lttng-tools.git diff --git a/tests/unit/test_utils_expand_path.cpp b/tests/unit/test_utils_expand_path.cpp index 85c8a5428..d11c2d919 100644 --- a/tests/unit/test_utils_expand_path.cpp +++ b/tests/unit/test_utils_expand_path.cpp @@ -15,8 +15,9 @@ #include -#include -#include +#include +#include +#include /* For error.h */ int lttng_opt_quiet = 1; @@ -131,14 +132,14 @@ static int prepare_valid_results(void) } /* allocate memory for the expected results */ - valid_tests_expected_results = (char **) zmalloc(sizeof(char *) * num_valid_tests); + valid_tests_expected_results = calloc(num_valid_tests); if (!valid_tests_expected_results) { PRINT_ERR("out of memory"); ret = -1; goto end; } for (i = 0; i < num_valid_tests; i++) { - valid_tests_expected_results[i] = (char *) malloc(PATH_MAX); + valid_tests_expected_results[i] = calloc(PATH_MAX); if (valid_tests_expected_results[i] == NULL) { PRINT_ERR("malloc expected results"); ret = -1; @@ -326,7 +327,7 @@ static void test_utils_expand_path(void) } } -int main(int argc, char **argv) +int main(void) { if (prepare_symlink_tree() != 0) { goto error_mkdir;