Gracefully free a NULL HANDSHAKE_RESULT
[openssl.git] / test / handshake_helper.c
index ce530c2c0601d4a8c0587aab9699cbef0b3c9d64..3e7f12948e478bc6bb0540ead0fd1a68a67685a5 100644 (file)
@@ -25,6 +25,8 @@ HANDSHAKE_RESULT *HANDSHAKE_RESULT_new()
 
 void HANDSHAKE_RESULT_free(HANDSHAKE_RESULT *result)
 {
 
 void HANDSHAKE_RESULT_free(HANDSHAKE_RESULT *result)
 {
+    if (result == NULL)
+        return;
     OPENSSL_free(result->client_npn_negotiated);
     OPENSSL_free(result->server_npn_negotiated);
     OPENSSL_free(result->client_alpn_negotiated);
     OPENSSL_free(result->client_npn_negotiated);
     OPENSSL_free(result->server_npn_negotiated);
     OPENSSL_free(result->client_alpn_negotiated);