From: John Kohl Date: Fri, 11 May 1990 16:07:43 +0000 (+0000) Subject: some lint changes (test these...the nocommon cases) X-Git-Tag: krb5-1.0-alpha2~559 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=80e37097b42284321c567e06fa834bd2a95fccba;p=krb5.git some lint changes (test these...the nocommon cases) be sure to put an anchor point (local tgt) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@846 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/walk_rtree.c b/src/lib/krb5/krb/walk_rtree.c index 9ce3fc07c..6f2c89acf 100644 --- a/src/lib/krb5/krb/walk_rtree.c +++ b/src/lib/krb5/krb/walk_rtree.c @@ -20,6 +20,7 @@ static char rcsid_walk_rtree_c[] = #include #include #include +#include "int-proto.h" /* internal function, used by krb5_get_cred_from_kdc() */ @@ -93,32 +94,33 @@ krb5_principal **tree; if (*ccp == REALM_BRANCH_CHAR) { links++; if (nocommon) - prevccp = ccp; + com_cdot = prevccp = ccp; } } - if (nocommon) - com_cdot = prevccp; for (scp = krb5_princ_realm(server)->data; scp < com_sdot; scp++) { if (*scp == REALM_BRANCH_CHAR) { links++; if (nocommon) - prevscp = scp; + com_sdot = prevscp = scp; } } - if (nocommon) - com_sdot = prevscp; if (nocommon && links == 3) { /* no components, and not the same */ com_cdot = krb5_princ_realm(client)->data; com_sdot = krb5_princ_realm(server)->data; } - if (!(rettree = (krb5_principal *)calloc(links+1, + if (!(rettree = (krb5_principal *)calloc(links+2, sizeof(krb5_principal)))) { return ENOMEM; } - i = 0; + i = 1; + if (retval = krb5_tgtname(krb5_princ_realm(client), + krb5_princ_realm(client), &rettree[0])) { + xfree(rettree); + return retval; + } for (prevccp = ccp = krb5_princ_realm(client)->data; ccp <= com_cdot; ccp++) {