aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDirkjan Bussink <d.bussink@gmail.com>2020-12-10 14:14:11 +0000
committerAndreas Schneider <asn@cryptomilk.org>2020-12-11 13:35:20 +0100
commit0987e6065c86f2f52b3c8835a0ad73d7ad082121 (patch)
tree1130f71b6fc271918046aff4502a3a3090b242a9 /tests
parentdaeee74edd8ac25c1d246d40333e78518574eded (diff)
downloadlibssh-0987e6065c86f2f52b3c8835a0ad73d7ad082121.tar.gz
libssh-0987e6065c86f2f52b3c8835a0ad73d7ad082121.tar.xz
libssh-0987e6065c86f2f52b3c8835a0ad73d7ad082121.zip
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 <d.bussink@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/torture_callbacks.c5
1 files changed, 5 insertions, 0 deletions
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);