summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGisle Vanem <gisle.vanem@gmail.com>2021-10-25 09:35:27 +0200
committerGitHub <noreply@github.com>2021-10-25 09:35:27 +0200
commit9ed4602fc528bbf6747352e9154ec410bf0606bf (patch)
tree1048ba1dd6e69b64b1634d986bfc59ca5463f937
parentf313d61c7b77d0251e76b25ca4e3598a00dfbc95 (diff)
downloadcurl-schannel-mem-leak.tar.gz
Fix "schannel: shutting down SSL/TLS..."schannel-mem-leak
Try to avoid two "schannel: shutting down SSL/TLS..." messages to be printed. And remove a too long MSDN link.
-rw-r--r--lib/vtls/schannel.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c
index 7c35e7feb..34547e591 100644
--- a/lib/vtls/schannel.c
+++ b/lib/vtls/schannel.c
@@ -1142,8 +1142,6 @@ schannel_connect_step2(struct Curl_easy *data, struct connectdata *conn,
if(!host_name)
return CURLE_OUT_OF_MEMORY;
- /* https://docs.microsoft.com/en-us/windows/win32/api/sspi/nf-sspi-initializesecuritycontexta
- */
sspi_status = s_pSecFn->InitializeSecurityContext(
&BACKEND->cred->cred_handle, &BACKEND->ctxt->ctxt_handle,
host_name, BACKEND->req_flags, 0, 0, &inbuf_desc, 0, NULL,
@@ -2133,7 +2131,12 @@ static void schannel_close(struct Curl_easy *data, struct connectdata *conn,
/* if the SSL/TLS channel hasn't been shut down yet, do that now. */
Curl_ssl_shutdown(data, conn, sockindex);
}
- schannel_shutdown(data, conn, sockindex);
+ else {
+ if (sockindex == 0)
+ infof(data, "schannel: shutting down SSL/TLS connection with %s port %hu",
+ SSL_HOST_NAME(), conn->remote_port);
+ schannel_shutdown(data, conn, sockindex);
+ }
}
static void schannel_session_free(void *ptr)
@@ -2159,9 +2162,6 @@ static int schannel_shutdown(struct Curl_easy *data, struct connectdata *conn,
DEBUGASSERT(data);
- infof(data, "schannel: shutting down SSL/TLS connection with %s port %hu",
- hostname, conn->remote_port);
-
if(BACKEND->cred && BACKEND->ctxt) {
SecBufferDesc BuffDesc;
SecBuffer Buffer;