Tests: add a check in test_utils_expand_path to avoid segfault if result is NULL
authorRaphaël Beamonte <raphael.beamonte@gmail.com>
Fri, 15 Nov 2013 00:58:31 +0000 (19:58 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 15 Nov 2013 15:18:25 +0000 (10:18 -0500)
Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
tests/unit/test_utils_expand_path.c

index 27bfe8fd2f92e81b313315c11a709fa3b150ac5b..b79744b3a55c596d2568d9147e83b34365ac50f3 100644 (file)
@@ -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);
                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);
        }
 
                free(result);
        }
This page took 0.036145 seconds and 4 git commands to generate.