SECPKG_CRED_OUTBOUND, NULL,
krb5->p_identity, NULL, NULL,
krb5->credentials, NULL);
- if(status != SEC_E_OK)
+ if(status != SEC_E_OK) {
+ curlx_free(krb5->credentials);
+ krb5->credentials = NULL;
return CURLE_LOGIN_DENIED;
+ }
/* Allocate our new context handle */
krb5->context = curlx_calloc(1, sizeof(CtxtHandle));
SECPKG_CRED_OUTBOUND, NULL,
ntlm->p_identity, NULL, NULL,
ntlm->credentials, NULL);
- if(status != SEC_E_OK)
+ if(status != SEC_E_OK) {
+ curlx_free(ntlm->credentials);
+ ntlm->credentials = NULL;
return CURLE_LOGIN_DENIED;
+ }
/* Allocate our new context handle */
ntlm->context = curlx_calloc(1, sizeof(CtxtHandle));
SECPKG_CRED_OUTBOUND, NULL,
nego->p_identity, NULL, NULL,
nego->credentials, NULL);
- if(nego->status != SEC_E_OK)
+ if(nego->status != SEC_E_OK) {
+ curlx_free(nego->credentials);
+ nego->credentials = NULL;
return CURLE_AUTH_ERROR;
+ }
/* Allocate our new context handle */
nego->context = curlx_calloc(1, sizeof(CtxtHandle));