From 34ff74eb183519ccedf11c97e754450469707951 Mon Sep 17 00:00:00 2001
From: Matt Caswell <matt@openssl.org>
Date: Mon, 26 Feb 2018 19:34:42 +0000
Subject: [PATCH] Clear some sslapitest global variables after use

Otherwise we get a use after free if the test order is randomised.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5467)
---
 test/sslapitest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/sslapitest.c b/test/sslapitest.c
index 1cf5c4fc6c..6480885fcd 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -3227,6 +3227,7 @@ static int test_export_key_mat_early(int idx)
         SSL_SESSION_free(sess);
     SSL_SESSION_free(clientpsk);
     SSL_SESSION_free(serverpsk);
+    clientpsk = serverpsk = NULL;
     SSL_free(serverssl);
     SSL_free(clientssl);
     SSL_CTX_free(sctx);
-- 
2.25.1