aboutsummaryrefslogtreecommitdiff
path: root/src/lib/kadm5
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2009-11-22 04:54:47 +0000
committerEzra Peisach <epeisach@mit.edu>2009-11-22 04:54:47 +0000
commit829462f1ae36623021b57a03aa1e4e6bb2dfbb6d (patch)
treebd12b10e5abd585d117c7a29ac5fadf3e17f63d0 /src/lib/kadm5
parentfe4fa8cdcae6d7e2668cc2678ba8d1ff8b0000cb (diff)
downloadkrb5-829462f1ae36623021b57a03aa1e4e6bb2dfbb6d.zip
krb5-829462f1ae36623021b57a03aa1e4e6bb2dfbb6d.tar.gz
krb5-829462f1ae36623021b57a03aa1e4e6bb2dfbb6d.tar.bz2
In _kadm5_init_any on error - if we created a cache entry, destroy it
(parallel to kadm5_destroy code). Also - free config_params. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23300 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/kadm5')
-rw-r--r--src/lib/kadm5/clnt/client_init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/kadm5/clnt/client_init.c b/src/lib/kadm5/clnt/client_init.c
index 82e4171..95c4954 100644
--- a/src/lib/kadm5/clnt/client_init.c
+++ b/src/lib/kadm5/clnt/client_init.c
@@ -174,6 +174,7 @@ static kadm5_ret_t _kadm5_init_any(krb5_context context, char *client_name,
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:
* 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 @@ error:
if(handle->clnt)
clnt_destroy(handle->clnt);
+ kadm5_free_config_params(handle->context, &handle->params);
+
cleanup:
if (code)
free(handle);