diff mbox series

[1/2] libsemanage/tests: return when str is NULL

Message ID 20190930202211.781578-1-nicolas.iooss@m4x.org (mailing list archive)
State Accepted
Headers show
Series [1/2] libsemanage/tests: return when str is NULL | expand

Commit Message

Nicolas Iooss Sept. 30, 2019, 8:22 p.m. UTC
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>
---
 libsemanage/tests/test_utilities.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/libsemanage/tests/test_utilities.c b/libsemanage/tests/test_utilities.c
index ba995b5ae094..fa3a077f5e92 100644
--- a/libsemanage/tests/test_utilities.c
+++ b/libsemanage/tests/test_utilities.c
@@ -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");