From 0987e6065c86f2f52b3c8835a0ad73d7ad082121 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Thu, 10 Dec 2020 14:14:11 +0000 Subject: Always check return value of ssh_list_new() Another item identified during code review was cases where the return value of ssh_list_new() was not properly checked and handled. This updates all cases that were missing this to handle failure to allocate a new list. Signed-off-by: Dirkjan Bussink Reviewed-by: Jakub Jelen Reviewed-by: Andreas Schneider --- tests/unittests/torture_callbacks.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/unittests/torture_callbacks.c b/tests/unittests/torture_callbacks.c index f5f7e4da..85f4d1f4 100644 --- a/tests/unittests/torture_callbacks.c +++ b/tests/unittests/torture_callbacks.c @@ -138,6 +138,9 @@ static void torture_callbacks_execute_list(void **state){ }; (void)state; + + assert_non_null(list); + ssh_callbacks_init(&c1); ssh_callbacks_init(&c2); ssh_callbacks_init(&c3); @@ -213,6 +216,8 @@ static void torture_callbacks_iterate(void **state){ (void)state; /* unused */ + assert_non_null(list); + ssh_callbacks_init(&c1); ssh_callbacks_init(&c2); -- cgit v1.2.1