Remove some null checks in cases where pointers can't be null
authorGreg Hudson <ghudson@mit.edu>
Fri, 23 Jan 2009 19:04:57 +0000 (19:04 +0000)
committerGreg Hudson <ghudson@mit.edu>
Fri, 23 Jan 2009 19:04:57 +0000 (19:04 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21790 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/krb5/accept_sec_context.c
src/lib/gssapi/krb5/init_sec_context.c
src/lib/gssapi/mechglue/g_initialize.c

index f96dfe5958207219c3d9b1764fea11a854e98c9c..e2ec1fe76a6423695d88623a0d105276f7fe5768 100644 (file)
@@ -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;
 
index 9a778a19510880bb8fff33a6aca5ac319b935c78..e7742216eb1d817c0a298230589019410098e354 100644 (file)
@@ -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;
index a6f0bbc8dda3eb5bf6f242d39f8b80e3450a7b6c..1149384a281ef342040cab358b3d418c63498bfe 100644 (file)
@@ -1111,9 +1111,7 @@ const char *fileName;
                        for (endp = modOptions;
                                *endp && *endp != ']'; endp++);
 
-                       if (endp)
-                               *endp = '\0';
-
+                       *endp = '\0';
                } else {
                        modOptions = NULL;
                }