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>
This commit is contained in:
Dirkjan Bussink
2020-12-10 14:14:11 +00:00
committed by Andreas Schneider
parent daeee74edd
commit 0987e6065c
5 changed files with 42 additions and 21 deletions

View File

@@ -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);