Address style issues.
[openssl.git] / test / ssltestlib.c
index 9bce0d32d10f312ead6122eda13ebc1714843ac9..4ee0bae9b90b09f7448bdfe11f815bc857a067d6 100644 (file)
@@ -288,7 +288,7 @@ void bio_s_mempacket_test_free(void)
 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())) {
@@ -518,7 +518,7 @@ int create_ssl_ctx_pair(const SSL_METHOD *sm, const SSL_METHOD *cm,
     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,
@@ -533,7 +533,8 @@ int create_ssl_ctx_pair(const SSL_METHOD *sm, const SSL_METHOD *cm,
 #endif
 
     *sctx = serverctx;
-    *cctx = clientctx;
+    if (cctx != NULL)
+        *cctx = clientctx;
     return 1;
 
  err: