aboutsummaryrefslogtreecommitdiff
path: root/lib/vtls
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2015-01-10 17:46:02 +0100
committerMarc Hoersken <info@marc-hoersken.de>2015-01-12 21:56:05 +0100
commite9834808e9e8ccb3028ecbe2b76475c111cc899a (patch)
treec724f219dfe9089a567b4ac30310dad9a98b118e /lib/vtls
parent710c38d7a4ca9dfeba579cb0094044f0c10c0de6 (diff)
curl_schannel.c: mark session as removed from cache if not freed
If the session is still used by active SSL/TLS connections, it cannot be closed yet. Thus we mark the session as not being cached any longer so that the reference counting mechanism in Curl_schannel_shutdown is used to close and free the session. Reported-by: Jean-Francois Durand
Diffstat (limited to 'lib/vtls')
-rw-r--r--lib/vtls/curl_schannel.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/vtls/curl_schannel.c b/lib/vtls/curl_schannel.c
index b3fe52695..787929c1d 100644
--- a/lib/vtls/curl_schannel.c
+++ b/lib/vtls/curl_schannel.c
@@ -1218,9 +1218,14 @@ void Curl_schannel_session_free(void *ptr)
{
struct curl_schannel_cred *cred = ptr;
- if(cred && cred->cached && cred->refcount == 0) {
- s_pSecFn->FreeCredentialsHandle(&cred->cred_handle);
- Curl_safefree(cred);
+ if(cred && cred->cached) {
+ if(cred->refcount == 0) {
+ s_pSecFn->FreeCredentialsHandle(&cred->cred_handle);
+ Curl_safefree(cred);
+ }
+ else {
+ cred->cached = FALSE;
+ }
}
}