Author: damitha
Date: Fri Jan 25 03:22:57 2008
New Revision: 615177

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

Modified:
    webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c
    webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
    webservices/sandesha/trunk/c/src/util/ack_mgr.c
    webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
    webservices/sandesha/trunk/c/src/util/terminate_mgr.c

Modified: 
webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c?rev=615177&r1=615176&r2=615177&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c 
(original)
+++ webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c 
Fri Jan 25 03:22:57 2008
@@ -180,7 +180,7 @@
         axis2_options_set_property(options, env, AXIS2_TIMEOUT_IN_SECONDS, 
             property);
     }
-    payload = build_om_payload_for_echo_svc(env, "echo1", seq_key);
+    /*payload = build_om_payload_for_echo_svc(env, "echo1", seq_key);
     result = axis2_svc_client_send_receive(svc_client, env, payload);
     if(result)
     {
@@ -217,7 +217,7 @@
     else
     {
         printf("\necho client two way single channel invoke FAILED!\n");
-    }
+    }*/
 
     property = axutil_property_create_with_args(env, 0, 0, 0, 
AXIS2_VALUE_TRUE);
     axis2_options_set_property(options, env, "Sandesha2LastMessage", property);

Modified: webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c?rev=615177&r1=615176&r2=615177&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Fri Jan 
25 03:22:57 2008
@@ -554,6 +554,8 @@
             msgs_str = axutil_strdup(env, msg_num_str);
         sandesha2_seq_property_bean_set_value(msgs_bean, env, msgs_str);
         sandesha2_seq_property_mgr_update(seq_prop_mgr, env, msgs_bean);
+        if(msgs_str)
+            AXIS2_FREE(env->allocator, msgs_str);
     }
     next_msg_bean = sandesha2_next_msg_mgr_retrieve(next_msg_mgr, env,
        str_seq_id);

Modified: webservices/sandesha/trunk/c/src/util/ack_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/ack_mgr.c?rev=615177&r1=615176&r2=615177&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/ack_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/ack_mgr.c Fri Jan 25 03:22:57 2008
@@ -50,7 +50,6 @@
     axis2_op_t *ack_op = NULL;
     axis2_op_t *ref_op = NULL;
     axis2_msg_ctx_t *ack_msg_ctx = NULL;
-    /*axis2_char_t *addr_ns_uri = NULL;*/
     axutil_property_t *property = NULL;
     sandesha2_msg_ctx_t *ack_rm_msg = NULL;
     axiom_soap_envelope_t *soap_env = NULL;
@@ -77,7 +76,6 @@
     }
     ack_op = axis2_op_create(env);
     axis2_op_set_msg_exchange_pattern(ack_op, env, AXIS2_MEP_URI_OUT_ONLY);
-    
     ref_op = axis2_msg_ctx_get_op(ref_msg, env);
     if(ref_op)
     {
@@ -96,7 +94,6 @@
     }
     ack_msg_ctx = sandesha2_utils_create_new_related_msg_ctx(env, ref_rm_msg,
         ack_op);
-    
     property = axutil_property_create_with_args(env, AXIS2_SCOPE_REQUEST, 
         AXIS2_FALSE, 0, AXIS2_VALUE_TRUE);
     if(property)

Modified: webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/sandesha2_utils.c?rev=615177&r1=615176&r2=615177&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Fri Jan 25 03:22:57 
2008
@@ -544,8 +544,6 @@
     axis2_conf_t *conf = NULL;
     axis2_transport_out_desc_t *out_desc = NULL;
     axis2_transport_in_desc_t *in_desc = NULL;
-    axis2_options_t *options = NULL;
-    axis2_svc_t *svc = NULL;
     axis2_op_ctx_t *op_ctx = NULL;
     axiom_soap_envelope_t *soap_env = NULL;
     axutil_property_t *property = NULL;
@@ -566,9 +564,6 @@
     in_desc = axis2_msg_ctx_get_transport_in_desc(ref_msg, env);
     
     new_msg = axis2_msg_ctx_create(env, conf_ctx, in_desc, out_desc);
-       
-    options = axis2_options_create(env);
-    axis2_msg_ctx_set_options(new_msg, env, options);
     svc_grp = axis2_msg_ctx_get_svc_grp(ref_msg, env); 
     if(svc_grp)
     {
@@ -583,7 +578,7 @@
         {
             axis2_svc_grp_ctx_t *svc_grp_ctx = NULL;
             svc_grp_ctx = axis2_svc_grp_ctx_create(env, 
-                        axis2_msg_ctx_get_svc_grp(ref_msg, env), conf_ctx);
+                axis2_msg_ctx_get_svc_grp(ref_msg, env), conf_ctx);
             axis2_msg_ctx_set_svc_grp_ctx(new_msg, env, svc_grp_ctx);
         }
     }
@@ -605,16 +600,16 @@
         if(axis2_msg_ctx_get_svc_ctx(ref_msg, env))
         {
             axis2_msg_ctx_set_svc_ctx(new_msg, env, 
-                        axis2_msg_ctx_get_svc_ctx(ref_msg, env));
+                axis2_msg_ctx_get_svc_ctx(ref_msg, env));
             axis2_msg_ctx_set_svc_ctx_id(new_msg, env, 
-                        axis2_msg_ctx_get_svc_ctx_id(ref_msg, env));
+                axis2_msg_ctx_get_svc_ctx_id(ref_msg, env));
         }
         else
         {
             axis2_svc_ctx_t *svc_ctx =  NULL;
             svc_ctx = axis2_svc_ctx_create(env, 
-                        axis2_msg_ctx_get_svc(ref_msg, env),
-                        axis2_msg_ctx_get_svc_grp_ctx(new_msg, env));
+                axis2_msg_ctx_get_svc(ref_msg, env),
+                axis2_msg_ctx_get_svc_grp_ctx(new_msg, env));
             axis2_msg_ctx_set_svc_ctx(new_msg, env, svc_ctx);
         }
     }
@@ -633,29 +628,18 @@
         
         svc_grp = axis2_msg_ctx_get_svc_grp(new_msg, env);
         axis2_svc_set_parent(axis_svc, env, axis2_msg_ctx_get_svc_grp(new_msg,
-                        env));
-         axis2_svc_grp_add_svc(svc_grp, env, axis_svc);
+            env));
+        axis2_svc_grp_add_svc(svc_grp, env, axis_svc);
         svc_grp_ctx = axis2_msg_ctx_get_svc_grp_ctx(new_msg, env);
         svc_ctx = axis2_svc_ctx_create(env, axis_svc, svc_grp_ctx);
     }
-    axis2_msg_ctx_set_op(new_msg, env, op);
-    svc = axis2_msg_ctx_get_svc(new_msg, env);
-    
-    if(svc && op)
-    {
-        axis2_svc_add_op(svc, env, op);
-        axis2_op_set_parent(op, env, svc);
-    }
-    
-    /*axutil_allocator_switch_to_global_pool(env->allocator);*/
     op_ctx = axis2_op_ctx_create(env, op, axis2_msg_ctx_get_svc_ctx(new_msg, 
         env));
-    /*axutil_allocator_switch_to_local_pool(env->allocator);*/
     axis2_msg_ctx_set_op_ctx(new_msg, env, op_ctx);
     
     soap_env = axiom_soap_envelope_create_default_soap_envelope(env, 
-                        sandesha2_utils_get_soap_version(env, 
-                        axis2_msg_ctx_get_soap_envelope(ref_msg, env)));
+        sandesha2_utils_get_soap_version(env, 
+        axis2_msg_ctx_get_soap_envelope(ref_msg, env)));
     axis2_msg_ctx_set_soap_envelope(new_msg, env, soap_env);
     
     transport_to = axis2_msg_ctx_get_transport_url(ref_msg, env);
@@ -673,7 +657,7 @@
         if(req_msg)
         {
             property = axis2_msg_ctx_get_property(req_msg, env, 
-                        AXIS2_WSA_VERSION);
+                AXIS2_WSA_VERSION);
             if(property)
                 addr_ver = axutil_property_get_value(property, env);
         }

Modified: webservices/sandesha/trunk/c/src/util/terminate_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/terminate_mgr.c?rev=615177&r1=615176&r2=615177&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/terminate_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/terminate_mgr.c Fri Jan 25 03:22:57 
2008
@@ -543,8 +543,9 @@
         {
             axis2_char_t *acks_to = NULL;
             acks_to = sandesha2_seq_property_bean_get_value(acks_to_bean, env);
-        if(sandesha2_utils_is_anon_uri(env, acks_to))
+            if(sandesha2_utils_is_anon_uri(env, acks_to))
                 stop_listner_for_async = AXIS2_TRUE;
+            sandesha2_seq_property_bean_free(acks_to_bean, env);
         }
         
     }
@@ -573,7 +574,11 @@
                         retrans_bean, env);
             sandesha2_storage_mgr_remove_msg_ctx(storage_mgr, env, 
                 msg_store_key, conf_ctx, -1);
+            if(retrans_bean)
+                sandesha2_sender_bean_free(retrans_bean, env);
         }
+        if(found_list)
+            axutil_array_list_free(found_list, env);
     }
     
     find_create_seq_bean = sandesha2_create_seq_bean_create(env);
@@ -602,8 +607,14 @@
                 " create_seq_bean with msg_id %s and internal_seq_id %s",
                 msg_id, internal_seq_id);
             sandesha2_create_seq_mgr_remove(create_seq_mgr, env, msg_id);
+            if(create_seq_bean)
+                sandesha2_create_seq_bean_free(create_seq_bean, env);
         }
     }
+    if(find_create_seq_bean)
+        sandesha2_create_seq_bean_free(find_create_seq_bean, env);
+    if(found_list)
+        axutil_array_list_free(found_list, env);
     
     find_seq_prop_bean = sandesha2_seq_property_bean_create(env);
     sandesha2_seq_property_bean_set_seq_id(find_seq_prop_bean, env, 
internal_seq_id);
@@ -645,8 +656,12 @@
                     seq_id);
                 sandesha2_seq_property_mgr_remove(seq_prop_mgr, env, seq_id, 
name);
             }
+            if(seq_prop_bean)
+                sandesha2_seq_property_bean_free(seq_prop_bean, env);
         }
     }
+    if(found_list)
+        axutil_array_list_free(found_list, env);
     if(out_seq_id)
         AXIS2_FREE(env->allocator, out_seq_id);
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 



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

Reply via email to