cc_ccache_iterator_release, cc_credentials_iterator leak server memory
authorAlexandra Ellwood <lxs@mit.edu>
Fri, 14 Mar 2008 18:47:32 +0000 (18:47 +0000)
committerAlexandra Ellwood <lxs@mit.edu>
Fri, 14 Mar 2008 18:47:32 +0000 (18:47 +0000)
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
src/ccapi/lib/ccapi_credentials_iterator.c

index 26162af327d8a1e9fae6a4f6243976adff081362..1d4dd6c5562c164a9317b4cc1845c9fa9d71a6e7 100644 (file)
@@ -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);
index 4f38d0745631fc1d08199354d04a1412ee9391dd..8d667acc479f3ef461ea35a0cb25dfd2a6bdf215 100644 (file)
@@ -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);