From 4f22ae4a30f22ed532355bc90d6a055299824094 Mon Sep 17 00:00:00 2001 From: JalonSolov Date: Wed, 21 Jul 2021 15:46:51 -0400 Subject: [PATCH] vschannel: add missing guards against multiple calls to vschannel_cleanup (#10895) --- thirdparty/vschannel/vschannel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/thirdparty/vschannel/vschannel.c b/thirdparty/vschannel/vschannel.c index 5753298496..34126d6b6e 100644 --- a/thirdparty/vschannel/vschannel.c +++ b/thirdparty/vschannel/vschannel.c @@ -60,11 +60,13 @@ void vschannel_cleanup(TlsContext *tls_ctx) { // Close socket. if(tls_ctx->socket != INVALID_SOCKET) { closesocket(tls_ctx->socket); + tls_ctx->socket = INVALID_SOCKET; } // Close "MY" certificate store. if(tls_ctx->cert_store) { CertCloseStore(tls_ctx->cert_store, 0); + tls_ctx->cert_store = NULL; } }