In the ccache serialization code, remove some unnecessary checks for
authorGreg Hudson <ghudson@mit.edu>
Tue, 10 Feb 2009 18:25:15 +0000 (18:25 +0000)
committerGreg Hudson <ghudson@mit.edu>
Tue, 10 Feb 2009 18:25:15 +0000 (18:25 +0000)
nullity of ccache->ops; we assume a valid ops pointer in neighboring
parts of the code.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21951 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/ser_cc.c

index d2abf532d4cdbf7e21796898de9da2badabfcd55..88e6a137dd35161ca72f2be65c185c9ec227b20d 100644 (file)
@@ -73,7 +73,7 @@ krb5_ccache_size(krb5_context kcontext, krb5_pointer arg, size_t *sizep)
         *      krb5_int32      for KV5M_CCACHE
         */
        required = sizeof(krb5_int32) * 3;
-       if (ccache->ops && ccache->ops->prefix)
+       if (ccache->ops->prefix)
            required += (strlen(ccache->ops->prefix)+1);
 
        /*
@@ -115,12 +115,11 @@ krb5_ccache_externalize(krb5_context kcontext, krb5_pointer arg, krb5_octet **bu
            (void) krb5_ser_pack_int32(KV5M_CCACHE, &bp, &remain);
 
            /* Calculate the length of the name */
-           namelen = (ccache->ops && ccache->ops->prefix) ?
-               strlen(ccache->ops->prefix)+1 : 0;
+           namelen = ccache->ops->prefix ? strlen(ccache->ops->prefix)+1 : 0;
            fnamep = krb5_cc_get_name(kcontext, ccache);
            namelen += (strlen(fnamep)+1);
 
-           if (ccache->ops && ccache->ops->prefix) {
+           if (ccache->ops->prefix) {
                if (asprintf(&ccname, "%s:%s", ccache->ops->prefix, fnamep) < 0)
                    ccname = NULL;
            } else