aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2006-06-30 04:46:36 +0000
committerTom Yu <tlyu@mit.edu>2006-06-30 04:46:36 +0000
commitc92184756189f0adbceab07cb61ee5b340f966cd (patch)
tree0dcb91716ce41cdc959c709936e4050a387f9620
parentb1468ee6f7b23d4340bb40529be929e63242dca7 (diff)
downloadkrb5-c92184756189f0adbceab07cb61ee5b340f966cd.zip
krb5-c92184756189f0adbceab07cb61ee5b340f966cd.tar.gz
krb5-c92184756189f0adbceab07cb61ee5b340f966cd.tar.bz2
pull up r18283 from trunk
r18283@cathode-dark-space: tlyu | 2006-06-29 23:57:20 -0400 ticket: 3962 tags: pullup * 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 version_fixed: 1.5 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-5@18284 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/lib/krb5/krb/srv_rcache.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/krb5/krb/srv_rcache.c b/src/lib/krb5/krb/srv_rcache.c
index da51b70..dc36827 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;