From 7ffb1a2044e4de13fa2cb4520c680d907f42770a Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Mon, 14 Oct 2013 10:32:34 +0200 Subject: krb5: Remove warning dereference of a null pointer Variable kr->creds is initialized in function krb5_get_init_creds_password. It does not make sense to check kr->creds for null, because we have already checked return value of function krb5_get_init_creds_password. Resolves: https://fedorahosted.org/sssd/ticket/2112 --- src/providers/krb5/krb5_child.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/providers/krb5') diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c index 20fb76318..90ebcff45 100644 --- a/src/providers/krb5/krb5_child.c +++ b/src/providers/krb5/krb5_child.c @@ -896,7 +896,6 @@ static krb5_error_code get_and_save_tgt(struct krb5_req *kr, int realm_length; krb5_error_code kerr; char *cc_name; - krb5_principal principal; kerr = sss_krb5_get_init_creds_opt_set_expire_callback(kr->ctx, kr->options, sss_krb5_expire_callback_func, @@ -941,13 +940,12 @@ static krb5_error_code get_and_save_tgt(struct krb5_req *kr, } } - principal = kr->creds ? kr->creds->client : kr->princ; - /* If kr->ccname is cache collection (DIR:/...), we want to work * directly with file ccache (DIR::/...), but cache collection * should be returned back to back end. */ - cc_name = sss_get_ccache_name_for_principal(kr->pd, kr->ctx, principal, + cc_name = sss_get_ccache_name_for_principal(kr->pd, kr->ctx, + kr->creds->client, kr->ccname); if (cc_name == NULL) { cc_name = kr->ccname; -- cgit