summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/auth/gensec/gensec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source4/auth/gensec/gensec.c b/source4/auth/gensec/gensec.c
index 4853b53e40..0832f2b07a 100644
--- a/source4/auth/gensec/gensec.c
+++ b/source4/auth/gensec/gensec.c
@@ -104,12 +104,15 @@ struct gensec_security_ops **gensec_security_mechs(struct gensec_security *gense
talloc_reference(mem_ctx, backends);
return backends;
} else {
+ enum credentials_use_kerberos use_kerberos;
struct cli_credentials *creds = gensec_get_credentials(gensec_security);
- enum credentials_use_kerberos use_kerberos
- = cli_credentials_get_kerberos_state(creds);
+ if (!creds) {
+ talloc_reference(mem_ctx, backends);
+ return backends;
+ }
+ use_kerberos = cli_credentials_get_kerberos_state(creds);
return gensec_use_kerberos_mechs(mem_ctx, backends, use_kerberos);
}
-
}
static const struct gensec_security_ops *gensec_security_by_authtype(struct gensec_security *gensec_security,