From 70c7c2cc98973d526de7e1e7f87f2b7e06e58867 Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Fri, 14 Mar 2008 18:47:32 +0000 Subject: [PATCH] cc_ccache_iterator_release, cc_credentials_iterator leak server memory cc_ccache_iterator_release and cc_credentials_iterator leak memory on the CCacheServer because they do not send an ipc message to the server telling it to free up resources associated with the iterator. Note: this issue does not track needing to be able to free up these same resources when the client crashes. ticket: new status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20276 dc483132-0cff-0310-8789-dd5450dbe970 --- src/ccapi/lib/ccapi_ccache_iterator.c | 19 +++++++++++++++++++ src/ccapi/lib/ccapi_credentials_iterator.c | 12 ++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/ccapi/lib/ccapi_ccache_iterator.c b/src/ccapi/lib/ccapi_ccache_iterator.c index 26162af32..1d4dd6c55 100644 --- a/src/ccapi/lib/ccapi_ccache_iterator.c +++ b/src/ccapi/lib/ccapi_ccache_iterator.c @@ -124,6 +124,25 @@ cc_int32 ccapi_ccache_iterator_release (cc_ccache_iterator_t io_ccache_iterator) if (!io_ccache_iterator) { err = ccErrBadParam; } + if (!err) { + cc_uint32 initialized = 0; + + err = cci_identifier_is_initialized (ccache_iterator->identifier, + &initialized); + + if (!err && initialized) { + err = cci_ipc_send (cci_ccache_iterator_release_msg_id, + ccache_iterator->identifier, + NULL, + NULL); + if (err) { + cci_debug_printf ("%s: cci_ipc_send failed with error %d", + __FUNCTION__, err); + err = ccNoError; + } + } + } + if (!err) { free ((char *) ccache_iterator->functions); cci_identifier_release (ccache_iterator->identifier); diff --git a/src/ccapi/lib/ccapi_credentials_iterator.c b/src/ccapi/lib/ccapi_credentials_iterator.c index 4f38d0745..8d667acc4 100644 --- a/src/ccapi/lib/ccapi_credentials_iterator.c +++ b/src/ccapi/lib/ccapi_credentials_iterator.c @@ -124,6 +124,18 @@ cc_int32 ccapi_credentials_iterator_release (cc_credentials_iterator_t io_creden if (!io_credentials_iterator) { err = ccErrBadParam; } + if (!err) { + err = cci_ipc_send (cci_credentials_iterator_next_msg_id, + credentials_iterator->identifier, + NULL, + NULL); + if (err) { + cci_debug_printf ("%s: cci_ipc_send failed with error %d", + __FUNCTION__, err); + err = ccNoError; + } + } + if (!err) { free ((char *) credentials_iterator->functions); cci_identifier_release (credentials_iterator->identifier); -- 2.26.2