From: Greg Hudson Date: Fri, 23 Jan 2009 19:04:57 +0000 (+0000) Subject: Remove some null checks in cases where pointers can't be null X-Git-Tag: krb5-1.7-alpha1~40 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=33abb530c443a842dda8370edf4a6fa0c725fc25;p=krb5.git Remove some null checks in cases where pointers can't be null git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21790 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/krb5/accept_sec_context.c b/src/lib/gssapi/krb5/accept_sec_context.c index f96dfe595..e2ec1fe76 100644 --- a/src/lib/gssapi/krb5/accept_sec_context.c +++ b/src/lib/gssapi/krb5/accept_sec_context.c @@ -334,9 +334,8 @@ kg_accept_dce(minor_status, context_handle, verifier_cred_handle, fail: /* real failure code follows */ - if (ctx) - (void) krb5_gss_delete_sec_context(minor_status, - (gss_ctx_id_t *) &ctx, NULL); + (void) krb5_gss_delete_sec_context(minor_status, (gss_ctx_id_t *) &ctx, + NULL); *context_handle = GSS_C_NO_CONTEXT; *minor_status = code; diff --git a/src/lib/gssapi/krb5/init_sec_context.c b/src/lib/gssapi/krb5/init_sec_context.c index 9a778a195..e7742216e 100644 --- a/src/lib/gssapi/krb5/init_sec_context.c +++ b/src/lib/gssapi/krb5/init_sec_context.c @@ -528,10 +528,8 @@ new_connection( &ctx->subkey); } - if (k_cred) { - krb5_free_creds(context, k_cred); - k_cred = NULL; - } + krb5_free_creds(context, k_cred); + k_cred = NULL; ctx->enc = NULL; ctx->seq = NULL; ctx->have_acceptor_subkey = 0; diff --git a/src/lib/gssapi/mechglue/g_initialize.c b/src/lib/gssapi/mechglue/g_initialize.c index a6f0bbc8d..1149384a2 100644 --- a/src/lib/gssapi/mechglue/g_initialize.c +++ b/src/lib/gssapi/mechglue/g_initialize.c @@ -1111,9 +1111,7 @@ const char *fileName; for (endp = modOptions; *endp && *endp != ']'; endp++); - if (endp) - *endp = '\0'; - + *endp = '\0'; } else { modOptions = NULL; }