svn rev #21790: trunk/src/lib/gssapi/ krb5/ mechglue/

ghudson@MIT.EDU ghudson at MIT.EDU
Fri Jan 23 14:04:59 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=21790
Commit By: ghudson
Log Message:
Remove some null checks in cases where pointers can't be null.



Changed Files:
U   trunk/src/lib/gssapi/krb5/accept_sec_context.c
U   trunk/src/lib/gssapi/krb5/init_sec_context.c
U   trunk/src/lib/gssapi/mechglue/g_initialize.c
Modified: trunk/src/lib/gssapi/krb5/accept_sec_context.c
===================================================================
--- trunk/src/lib/gssapi/krb5/accept_sec_context.c	2009-01-23 19:01:56 UTC (rev 21789)
+++ trunk/src/lib/gssapi/krb5/accept_sec_context.c	2009-01-23 19:04:57 UTC (rev 21790)
@@ -334,9 +334,8 @@
  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;
 

Modified: trunk/src/lib/gssapi/krb5/init_sec_context.c
===================================================================
--- trunk/src/lib/gssapi/krb5/init_sec_context.c	2009-01-23 19:01:56 UTC (rev 21789)
+++ trunk/src/lib/gssapi/krb5/init_sec_context.c	2009-01-23 19:04:57 UTC (rev 21790)
@@ -528,10 +528,8 @@
                                     &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;

Modified: trunk/src/lib/gssapi/mechglue/g_initialize.c
===================================================================
--- trunk/src/lib/gssapi/mechglue/g_initialize.c	2009-01-23 19:01:56 UTC (rev 21789)
+++ trunk/src/lib/gssapi/mechglue/g_initialize.c	2009-01-23 19:04:57 UTC (rev 21790)
@@ -1111,9 +1111,7 @@
 			for (endp = modOptions;
 				*endp && *endp != ']'; endp++);
 
-			if (endp)
-				*endp = '\0';
-
+			*endp = '\0';
 		} else {
 			modOptions = NULL;
 		}




More information about the cvs-krb5 mailing list