static int mempacket_test_new(BIO *bio)
{
MEMPACKET_TEST_CTX *ctx;
-
+
if (!TEST_ptr(ctx = OPENSSL_zalloc(sizeof(*ctx))))
return 0;
if (!TEST_ptr(ctx->pkts = sk_MEMPACKET_new_null())) {
SSL_CTX *clientctx = NULL;
if (!TEST_ptr(serverctx = SSL_CTX_new(sm))
- || !TEST_ptr(clientctx = SSL_CTX_new(cm)))
+ || (cctx != NULL && !TEST_ptr(clientctx = SSL_CTX_new(cm))))
goto err;
if (!TEST_int_eq(SSL_CTX_use_certificate_file(serverctx, certfile,
#endif
*sctx = serverctx;
- *cctx = clientctx;
+ if (cctx != NULL)
+ *cctx = clientctx;
return 1;
err: