test/ct_test.c: Add the missing check after calling sk_SCT_new_null
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Mon, 24 Jan 2022 03:18:38 +0000 (11:18 +0800)
committerTomas Mraz <tomas@openssl.org>
Tue, 25 Jan 2022 17:15:22 +0000 (18:15 +0100)
commit7625d70ad9e7be0588dd9453e89892c2b24b8175
tree0196501ad8b2d0137861ed04b8ac199529c61602
parent2208ba56ebefe4cf7d924e2ac7044ccd3307250b
test/ct_test.c: Add the missing check after calling sk_SCT_new_null

As the potential failure of the allocation, the sk_SCT_new_null() could
return NULL pointer if fails.
And then sk_SCT_push() uses the 'fixture->sct_list' and returns -1 if
fails.
But the return value of the sk_SCT_push() is not checked.
I think it is better to check it just after the allocation.

CLA: trivial

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17571)
test/ct_test.c