X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Funit%2Ftest_utils_expand_path.cpp;h=d11c2d9198d46605f54bab9073c1a8c7bdd03d42;hb=64803277bbdbe0a943360d918298a48157d9da55;hp=e85cbbced9c4af4a546d629a445a70fb361a1697;hpb=f46376a14da2eb796690cb4e718e8b213839d6ea;p=lttng-tools.git diff --git a/tests/unit/test_utils_expand_path.cpp b/tests/unit/test_utils_expand_path.cpp index e85cbbced..d11c2d919 100644 --- a/tests/unit/test_utils_expand_path.cpp +++ b/tests/unit/test_utils_expand_path.cpp @@ -15,9 +15,9 @@ #include -#include -#include -#include +#include +#include +#include /* For error.h */ int lttng_opt_quiet = 1; @@ -132,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;