libsemanage/tests: return when str is NULL

CU_FAIL() does not stop the execution flow.

This issue has been found using Infer static analyzer.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
Nicolas Iooss 2019-09-30 22:22:10 +02:00 committed by Stephen Smalley
parent adcc353f6e
commit 7673b97e45

View file

@ -142,6 +142,7 @@ void test_semanage_split_on_space(void)
if (!str) {
CU_FAIL
("semanage_split_on_space: unable to perform test, no memory");
return;
}
temp = semanage_split_on_space(str);
CU_ASSERT_STRING_EQUAL(temp, "bar baz");