(make_path): make sure we return allocated memory

Coverity, NetBSD CID#1892


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17043 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-04-10 10:26:35 +00:00
parent 69dda05a9c
commit 2eeae67af7

View File

@@ -100,8 +100,10 @@ make_path(krb5_context context, struct tr_realm *r,
p = from + strlen(from);
while(1){
while(p >= from && *p != '/') p--;
if(p == from)
if(p == from) {
r->next = path; /* XXX */
return KRB5KDC_ERR_POLICY;
}
if(strncmp(to, from, p - from) == 0)
break;
tmp = calloc(1, sizeof(*tmp));