From: Greg Hudson Date: Tue, 10 Feb 2009 18:25:15 +0000 (+0000) Subject: In the ccache serialization code, remove some unnecessary checks for X-Git-Tag: krb5-1.8-alpha1~662 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dc8410d699a0cf9d1f0d47804ba0b4920cdf46ae;p=krb5.git In the ccache serialization code, remove some unnecessary checks for 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 --- diff --git a/src/lib/krb5/ccache/ser_cc.c b/src/lib/krb5/ccache/ser_cc.c index d2abf532d..88e6a137d 100644 --- a/src/lib/krb5/ccache/ser_cc.c +++ b/src/lib/krb5/ccache/ser_cc.c @@ -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