From 80e37097b42284321c567e06fa834bd2a95fccba Mon Sep 17 00:00:00 2001 From: John Kohl Date: Fri, 11 May 1990 16:07:43 +0000 Subject: [PATCH] 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 --- src/lib/krb5/krb/walk_rtree.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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++) { -- 2.26.2