X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Funit%2Ftest_utils_expand_path.cpp;fp=tests%2Funit%2Ftest_utils_expand_path.cpp;h=d11c2d9198d46605f54bab9073c1a8c7bdd03d42;hp=3cb1a81604c585ae12fe898ebbb0109deffb8586;hb=64803277bbdbe0a943360d918298a48157d9da55;hpb=60f1b42d6280b6bd386abb726dca4fd3b31d8491 diff --git a/tests/unit/test_utils_expand_path.cpp b/tests/unit/test_utils_expand_path.cpp index 3cb1a8160..d11c2d919 100644 --- a/tests/unit/test_utils_expand_path.cpp +++ b/tests/unit/test_utils_expand_path.cpp @@ -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;