Fix a leak in SSL_clear()
[openssl.git] / test / sslapitest.c
index add38cf62228d8137ec72bbdb0501cab7515dec1..e370807bbc53ed011cc9c822dac71a4c0fc063c8 100644 (file)
@@ -100,8 +100,16 @@ static int execute_test_large_message(const SSL_METHOD *smeth,
         goto end;
     }
 
-    testresult = 1;
+    /*
+     * Calling SSL_clear() first is not required but this tests that SSL_clear()
+     * doesn't leak (when using enable-crypto-mdebug).
+     */
+    if (!SSL_clear(serverssl)) {
+        printf("Unexpected failure from SSL_clear()\n");
+        goto end;
+    }
 
+    testresult = 1;
  end:
     X509_free(chaincert);
     SSL_free(serverssl);