Commit e9834808 authored by Marc Hoersken's avatar Marc Hoersken
Browse files

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
parent 710c38d7
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -1218,10 +1218,15 @@ void Curl_schannel_session_free(void *ptr)
{
{
  struct curl_schannel_cred *cred = ptr;
  struct curl_schannel_cred *cred = ptr;


  if(cred && cred->cached && cred->refcount == 0) {
  if(cred && cred->cached) {
    if(cred->refcount == 0) {
      s_pSecFn->FreeCredentialsHandle(&cred->cred_handle);
      s_pSecFn->FreeCredentialsHandle(&cred->cred_handle);
      Curl_safefree(cred);
      Curl_safefree(cred);
    }
    }
    else {
      cred->cached = FALSE;
    }
  }
}
}


int Curl_schannel_init(void)
int Curl_schannel_init(void)