summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandra Ellwood <lxs@mit.edu>1999-08-03 16:40:23 +0000
committerAlexandra Ellwood <lxs@mit.edu>1999-08-03 16:40:23 +0000
commit9e4694157b9b36d9690046bb7e520bf1fc86eb5e (patch)
tree5e64f041ec5ebcf3707621b18527d329bb5716c5
parent45770d93d709fbeae92fc1ddb62e6da683280eeb (diff)
downloadkrb5-9e4694157b9b36d9690046bb7e520bf1fc86eb5e.tar.gz
krb5-9e4694157b9b36d9690046bb7e520bf1fc86eb5e.tar.xz
krb5-9e4694157b9b36d9690046bb7e520bf1fc86eb5e.zip
Fixed a memory leak in krb5_stdcc_destroy(). The destroy function was failing to free memory allocated for the krb5_ccache. Code to free this memory was swiped from krb5_stdcc_close()
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11613 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/lib/krb5/ccache/ccapi/stdcc.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/lib/krb5/ccache/ccapi/stdcc.c b/src/lib/krb5/ccache/ccapi/stdcc.c
index 2a7a9775f8..db93102cad 100644
--- a/src/lib/krb5/ccache/ccapi/stdcc.c
+++ b/src/lib/krb5/ccache/ccapi/stdcc.c
@@ -614,9 +614,19 @@ krb5_stdcc_destroy (krb5_context context, krb5_ccache id)
return retval;
}
- /* destroy the named cache */
- err = cc_destroy(gCntrlBlock, &ccapi_data->NamedCache);
- cache_changed();
+ /* free memory associated with the krb5_ccache */
+ if (ccapi_data) {
+ if (ccapi_data->cache_name)
+ free(ccapi_data->cache_name);
+ if (ccapi_data->NamedCache) {
+ /* destroy the named cache */
+ err = cc_destroy(gCntrlBlock, &ccapi_data->NamedCache);
+ cache_changed();
+ }
+ free(ccapi_data);
+ id->data = NULL;
+ }
+ free(id);
return cc_err_xlate(err);
}