Author: damitha
Date: Wed Jan  2 22:33:53 2008
New Revision: 608355

URL: http://svn.apache.org/viewvc?rev=608355&view=rev
Log:
fixing memory leaks

Modified:
    
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c
    
webservices/sandesha/trunk/c/src/msgprocessors/make_connection_msg_processor.c
    webservices/sandesha/trunk/c/src/storage/sqlite/permanent_sender_mgr.c
    webservices/sandesha/trunk/c/src/workers/sender_worker.c

Modified: 
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c?rev=608355&r1=608354&r2=608355&view=diff
==============================================================================
--- 
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c 
(original)
+++ 
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c 
Wed Jan  2 22:33:53 2008
@@ -310,6 +310,9 @@
     }
     create_seq_storage_key = sandesha2_sender_bean_get_msg_ctx_ref_key(
                         create_seq_sender_bean, env);
+    if(create_seq_sender_bean)
+        sandesha2_sender_bean_free((sandesha2_rm_bean_t *) 
+            create_seq_sender_bean, env);
     sandesha2_storage_mgr_remove_msg_ctx(storage_mgr, env, 
         create_seq_storage_key, conf_ctx);
     sandesha2_sender_mgr_remove(sender_mgr, env, create_seq_msg_id);

Modified: 
webservices/sandesha/trunk/c/src/msgprocessors/make_connection_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/make_connection_msg_processor.c?rev=608355&r1=608354&r2=608355&view=diff
==============================================================================
--- 
webservices/sandesha/trunk/c/src/msgprocessors/make_connection_msg_processor.c 
(original)
+++ 
webservices/sandesha/trunk/c/src/msgprocessors/make_connection_msg_processor.c 
Wed Jan  2 22:33:53 2008
@@ -482,6 +482,8 @@
             sandesha2_storage_mgr_remove_msg_ctx(storage_mgr, env, 
                 msg_stored_key, conf_ctx);
         }
+        if(bean1)
+            sandesha2_sender_bean_free((sandesha2_rm_bean_t *)bean1, env);
     }
     msg_type = sandesha2_msg_ctx_get_msg_type(return_rm_msg_ctx, env);
     if(SANDESHA2_MSG_TYPE_TERMINATE_SEQ == msg_type)

Modified: webservices/sandesha/trunk/c/src/storage/sqlite/permanent_sender_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/permanent_sender_mgr.c?rev=608355&r1=608354&r2=608355&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/permanent_sender_mgr.c 
(original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/permanent_sender_mgr.c Wed 
Jan  2 22:33:53 2008
@@ -629,6 +629,8 @@
     match_list = sandesha2_permanent_bean_mgr_find(sender_mgr_impl->bean_mgr, 
env, 
         (sandesha2_rm_bean_t *) matcher, sandesha2_sender_find_callback,
         sql_find);
+    if(matcher)
+        sandesha2_sender_bean_free((sandesha2_rm_bean_t *)matcher, env);
 
     /*
      * We either return an application message or an RM message. If we find

Modified: webservices/sandesha/trunk/c/src/workers/sender_worker.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/sender_worker.c?rev=608355&r1=608354&r2=608355&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender_worker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender_worker.c Wed Jan  2 
22:33:53 2008
@@ -226,6 +226,9 @@
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
             "[sandesha2]msg_ctx is not present in the store yet.");
         /*msg_ctx is still not stored so try again later.*/
+        if(sender_worker_bean)
+            sandesha2_sender_bean_free((sandesha2_rm_bean_t *) 
+                sender_worker_bean, env);
         return AXIS2_SUCCESS;
     }
     continue_sending = sandesha2_msg_retrans_adjuster_adjust_retrans(env,
@@ -237,6 +240,9 @@
         status = AXIS2_FAILURE;
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
             "[sandesha2]Do not continue sending the message");
+        if(sender_worker_bean)
+            sandesha2_sender_bean_free(
+                (sandesha2_rm_bean_t *)sender_worker_bean, env);
         return status;
     }
     
@@ -250,6 +256,9 @@
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
             "[sandesha2]Message is not qualified for sending");
 
+        if(sender_worker_bean)
+            sandesha2_sender_bean_free(
+                (sandesha2_rm_bean_t *)sender_worker_bean, env);
         /*return success here to wait till the message is qualified for 
sending*/
         return AXIS2_SUCCESS;
     }
@@ -281,6 +290,9 @@
         {
             AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]Continue "\
                 "Sending is true. So returning from Sender Worker");
+            if(sender_worker_bean)
+                sandesha2_sender_bean_free(
+                (sandesha2_rm_bean_t *)sender_worker_bean, env);
             return AXIS2_SUCCESS;
         }
     }
@@ -355,6 +367,11 @@
                 msg_stored_key, conf_ctx);
         }
     }
+    if(bean1)
+        sandesha2_sender_bean_free((sandesha2_rm_bean_t *) bean1, env);
+    if(sender_worker_bean)
+        sandesha2_sender_bean_free((sandesha2_rm_bean_t *)sender_worker_bean, 
+            env);
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]msg_type:%d", 
msg_type);
     if(successfully_sent)
     {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to