return retcode;
}
else {
+ connssl->cred->cached = TRUE;
infof(data, "schannel: stored credential handle in session cache\n");
}
}
connssl->cred->refcount);
}
- /* if the handle refcount is zero, check if we have not cached it */
- if(connssl->cred->refcount == 0) {
- if(Curl_ssl_getsessionid(conn, (void**)&cached_cred, NULL)) {
- cached_cred = NULL;
- }
- /* if the handle was not cached, it is stale to be freed */
- if(connssl->cred != cached_cred) {
- infof(data, "schannel: clear credential handle\n");
- s_pSecFn->FreeCredentialsHandle(&connssl->cred->cred_handle);
- Curl_safefree(connssl->cred);
- }
+ /* if the handle was not cached and the refcount is zero */
+ if(!connssl->cred->cached && connssl->cred->refcount == 0) {
+ infof(data, "schannel: clear credential handle\n");
+ s_pSecFn->FreeCredentialsHandle(&connssl->cred->cred_handle);
+ Curl_safefree(connssl->cred);
}
}
}
{
struct curl_schannel_cred *cred = ptr;
- if(cred && cred->refcount == 0) {
+ if(cred && cred->cached && cred->refcount == 0) {
s_pSecFn->FreeCredentialsHandle(&cred->cred_handle);
Curl_safefree(cred);
}