diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index f0b6780fca6f..3848abc9034b 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -644,7 +644,8 @@ void Curl_auth_digest_cleanup(struct digestdata *digest) /* Delete security context */ if(digest->http_context) { - Curl_pSecFn->DeleteSecurityContext(digest->http_context); + if(Curl_pSecFn) + Curl_pSecFn->DeleteSecurityContext(digest->http_context); curlx_safefree(digest->http_context); } diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c index e7491be022f8..55f903782afb 100644 --- a/lib/vauth/krb5_sspi.c +++ b/lib/vauth/krb5_sspi.c @@ -427,14 +427,16 @@ void Curl_auth_cleanup_gssapi(struct kerberos5data *krb5) { /* Free our security context */ if(krb5->context) { - Curl_pSecFn->DeleteSecurityContext(krb5->context); + if(Curl_pSecFn) + Curl_pSecFn->DeleteSecurityContext(krb5->context); curlx_free(krb5->context); krb5->context = NULL; } /* Free our credentials handle */ if(krb5->credentials) { - Curl_pSecFn->FreeCredentialsHandle(krb5->credentials); + if(Curl_pSecFn) + Curl_pSecFn->FreeCredentialsHandle(krb5->credentials); curlx_free(krb5->credentials); krb5->credentials = NULL; } diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c index 4c41eb21f4e6..56855724c82c 100644 --- a/lib/vauth/ntlm_sspi.c +++ b/lib/vauth/ntlm_sspi.c @@ -324,14 +324,16 @@ void Curl_auth_cleanup_ntlm(struct ntlmdata *ntlm) { /* Free our security context */ if(ntlm->context) { - Curl_pSecFn->DeleteSecurityContext(ntlm->context); + if(Curl_pSecFn) + Curl_pSecFn->DeleteSecurityContext(ntlm->context); curlx_free(ntlm->context); ntlm->context = NULL; } /* Free our credentials handle */ if(ntlm->credentials) { - Curl_pSecFn->FreeCredentialsHandle(ntlm->credentials); + if(Curl_pSecFn) + Curl_pSecFn->FreeCredentialsHandle(ntlm->credentials); curlx_free(ntlm->credentials); ntlm->credentials = NULL; } diff --git a/lib/vauth/spnego_sspi.c b/lib/vauth/spnego_sspi.c index 1baf59320a37..97f319510b88 100644 --- a/lib/vauth/spnego_sspi.c +++ b/lib/vauth/spnego_sspi.c @@ -312,14 +312,16 @@ void Curl_auth_cleanup_spnego(struct negotiatedata *nego) { /* Free our security context */ if(nego->context) { - Curl_pSecFn->DeleteSecurityContext(nego->context); + if(Curl_pSecFn) + Curl_pSecFn->DeleteSecurityContext(nego->context); curlx_free(nego->context); nego->context = NULL; } /* Free our credentials handle */ if(nego->credentials) { - Curl_pSecFn->FreeCredentialsHandle(nego->credentials); + if(Curl_pSecFn) + Curl_pSecFn->FreeCredentialsHandle(nego->credentials); curlx_free(nego->credentials); nego->credentials = NULL; }