From mboxrd@z Thu Jan 1 00:00:00 1970 From: raphael.beamonte@gmail.com (=?UTF-8?q?Rapha=C3=ABl=20Beamonte?=) Date: Thu, 14 Nov 2013 19:58:31 -0500 Subject: [lttng-dev] [lttng-tools PATCH 1/5] Tests: add a check in test_utils_expand_path to avoid segfault if result is NULL In-Reply-To: <1384477115-18809-1-git-send-email-raphael.beamonte@gmail.com> References: <1517784416.67313.1384445660213.JavaMail.zimbra@efficios.com> <1384477115-18809-1-git-send-email-raphael.beamonte@gmail.com> Message-ID: <1384477115-18809-2-git-send-email-raphael.beamonte@gmail.com> Signed-off-by: Rapha?l Beamonte --- 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 27bfe8f..b79744b 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); } -- 1.7.10.4