svn rev #21842: trunk/src/lib/krb5/krb/

ghudson@MIT.EDU ghudson at MIT.EDU
Fri Jan 30 16:25:41 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=21842
Commit By: ghudson
Log Message:
krb5_get_server_rcache had some dead (and incorrect) code for cleaning
up the rcache on failure.  Fix the cleanup code and make use of it.



Changed Files:
U   trunk/src/lib/krb5/krb/srv_rcache.c
Modified: trunk/src/lib/krb5/krb/srv_rcache.c
===================================================================
--- trunk/src/lib/krb5/krb/srv_rcache.c	2009-01-30 21:22:31 UTC (rev 21841)
+++ trunk/src/lib/krb5/krb/srv_rcache.c	2009-01-30 21:25:40 UTC (rev 21842)
@@ -71,21 +71,13 @@
 	return ENOMEM;
 
     retval = krb5_rc_resolve_full(context, &rcache, cachename);
-    if (retval) {
-	rcache = 0;
+    if (retval)
 	goto cleanup;
-    }
 
-    /*
-     * First try to recover the replay cache; if that doesn't work,
-     * initialize it.
-     */
-    retval = krb5_rc_recover_or_initialize(context, rcache, context->clockskew);
-    if (retval) {
-	krb5_rc_close(context, rcache);
-	rcache = 0;
+    retval = krb5_rc_recover_or_initialize(context, rcache,
+					   context->clockskew);
+    if (retval)
 	goto cleanup;
-    }
 
     *rcptr = rcache;
     rcache = 0;
@@ -93,7 +85,7 @@
 
 cleanup:
     if (rcache)
-	free(rcache);
+	krb5_rc_close(context, rcache);
     if (cachename)
 	free(cachename);
     return retval;




More information about the cvs-krb5 mailing list