From: Raphaël Beamonte Date: Fri, 15 Nov 2013 00:58:31 +0000 (-0500) Subject: Tests: add a check in test_utils_expand_path to avoid segfault if result is NULL X-Git-Tag: v2.4.0-rc1~6 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ba526563ed68f8eb8d45d2814946c0694ba8f71e;p=lttng-tools.git Tests: add a check in test_utils_expand_path to avoid segfault if result is NULL Signed-off-by: Raphaël Beamonte Signed-off-by: David Goulet --- diff --git a/tests/unit/test_utils_expand_path.c b/tests/unit/test_utils_expand_path.c index 27bfe8fd2..b79744b3a 100644 --- a/tests/unit/test_utils_expand_path.c +++ b/tests/unit/test_utils_expand_path.c @@ -135,7 +135,8 @@ static void test_utils_expand_path(void) sprintf(name, "valid test case: %s", valid_tests_inputs[i].input); result = utils_expand_path(valid_tests_inputs[i].input); - ok(strcmp(result, valid_tests_expected_results[i]) == 0, name); + ok(result != NULL && + strcmp(result, valid_tests_expected_results[i]) == 0, name); free(result); }