From: Tom Yu Date: Fri, 30 Jun 2006 03:57:20 +0000 (+0000) Subject: * src/lib/krb5/krb/srv_rcache.c (krb5_get_server_rcache): Adapted X-Git-Tag: krb5-1.6-alpha1~231 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b1dea37d9afff88fc76560c00dfe0e8ab324d193;p=krb5.git * src/lib/krb5/krb/srv_rcache.c (krb5_get_server_rcache): Adapted 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 --- diff --git a/src/lib/krb5/krb/srv_rcache.c b/src/lib/krb5/krb/srv_rcache.c index da51b70b7..dc3682757 100644 --- a/src/lib/krb5/krb/srv_rcache.c +++ b/src/lib/krb5/krb/srv_rcache.c @@ -105,8 +105,10 @@ krb5_get_server_rcache(krb5_context context, const krb5_data *piece, 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, @@ -119,9 +121,12 @@ krb5_get_server_rcache(krb5_context context, const krb5_data *piece, } *rcptr = rcache; + rcache = 0; retval = 0; cleanup: + if (rcache) + krb5_xfree(rcache); if (cachename) krb5_xfree(cachename); return retval;