svn rev #23300: trunk/src/lib/kadm5/clnt/

epeisach@MIT.EDU epeisach at MIT.EDU
Sat Nov 21 23:54:47 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=23300
Commit By: epeisach
Log Message:
In _kadm5_init_any on error - if we created a cache entry, destroy it
(parallel to kadm5_destroy code). Also - free config_params.





Changed Files:
U   trunk/src/lib/kadm5/clnt/client_init.c
Modified: trunk/src/lib/kadm5/clnt/client_init.c
===================================================================
--- trunk/src/lib/kadm5/clnt/client_init.c	2009-11-22 04:26:48 UTC (rev 23299)
+++ trunk/src/lib/kadm5/clnt/client_init.c	2009-11-22 04:54:47 UTC (rev 23300)
@@ -174,6 +174,7 @@
     int iprop_enable = 0;
     char full_svcname[BUFSIZ];
     char *realm;
+    krb5_ccache ccache;
 
     kadm5_server_handle_t handle;
     kadm5_config_params params_local;
@@ -390,6 +391,11 @@
      * error" before the block of code at the top of the function
      * that allocates and initializes "handle".
      */
+    if (handle->destroy_cache && handle->cache_name) {
+        if (krb5_cc_resolve(handle->context,
+                            handle->cache_name, &ccache) == 0)
+            (void) krb5_cc_destroy (handle->context, ccache);
+    }
     if (handle->cache_name)
         free(handle->cache_name);
     if(handle->clnt && handle->clnt->cl_auth)
@@ -397,6 +403,8 @@
     if(handle->clnt)
         clnt_destroy(handle->clnt);
 
+    kadm5_free_config_params(handle->context, &handle->params);
+
 cleanup:
     if (code)
         free(handle);




More information about the cvs-krb5 mailing list