From ba526563ed68f8eb8d45d2814946c0694ba8f71e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Beamonte?= Date: Thu, 14 Nov 2013 19:58:31 -0500 Subject: [PATCH] Tests: add a check in test_utils_expand_path to avoid segfault if result is NULL MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Beamonte Signed-off-by: David Goulet --- tests/unit/test_utils_expand_path.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- 2.34.1