patch from Shawn Emery to set rcache = 0 in case of
krb5_rc_resolve_full failure because krb5_rc_resolve_full frees
but doesn't null rcache. Also restore free of rcache in cleanup
code. Continue to not null rcache in failure on
krb5_rc_recover_or_initialize because krb5_rc_close doesn't free
rcache.
ticket: 3962
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18283
dc483132-0cff-0310-8789-
dd5450dbe970
cachename[p++] = '\0';
retval = krb5_rc_resolve_full(context, &rcache, cachename);
- if (retval)
+ if (retval) {
+ rcache = 0;
goto cleanup;
+ }
/*
* First try to recover the replay cache; if that doesn't work,
}
*rcptr = rcache;
+ rcache = 0;
retval = 0;
cleanup:
+ if (rcache)
+ krb5_xfree(rcache);
if (cachename)
krb5_xfree(cachename);
return retval;