summaryrefslogtreecommitdiffstats
path: root/test/cmp_client_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/cmp_client_test.c')
-rw-r--r--test/cmp_client_test.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/cmp_client_test.c b/test/cmp_client_test.c
index 208e0a1767..bacdac35c5 100644
--- a/test/cmp_client_test.c
+++ b/test/cmp_client_test.c
@@ -187,8 +187,11 @@ static int test_exec_IR_ses(void)
fixture->req_type = OSSL_CMP_PKIBODY_IR;
fixture->expected = OSSL_CMP_PKISTATUS_accepted;
fixture->caPubs = sk_X509_new_null();
- sk_X509_push(fixture->caPubs, server_cert);
- sk_X509_push(fixture->caPubs, server_cert);
+ if (!sk_X509_push(fixture->caPubs, server_cert)
+ || !sk_X509_push(fixture->caPubs, server_cert)) {
+ tear_down(fixture);
+ return 0;
+ }
ossl_cmp_mock_srv_set1_caPubsOut(fixture->srv_ctx, fixture->caPubs);
EXECUTE_TEST(execute_exec_certrequest_ses_test, tear_down);
return result;