Author: damitha
Date: Thu Jan 24 00:18:35 2008
New Revision: 614817

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

Modified:
    webservices/sandesha/trunk/c/src/handlers/sandesha2_global_in_handler.c
    webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c
    webservices/sandesha/trunk/c/src/util/fault_mgr.c
    webservices/sandesha/trunk/c/src/util/msg_init.c
    webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
    webservices/sandesha/trunk/c/src/util/terminate_mgr.c

Modified: 
webservices/sandesha/trunk/c/src/handlers/sandesha2_global_in_handler.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/handlers/sandesha2_global_in_handler.c?rev=614817&r1=614816&r2=614817&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/handlers/sandesha2_global_in_handler.c 
(original)
+++ webservices/sandesha/trunk/c/src/handlers/sandesha2_global_in_handler.c Thu 
Jan 24 00:18:35 2008
@@ -93,18 +93,18 @@
 {
     
     axis2_conf_ctx_t *conf_ctx = NULL;
-    axis2_ctx_t *ctx = NULL;
+    /*axis2_ctx_t *ctx = NULL;*/
+    /*axis2_char_t *reinjected_msg = AXIS2_FALSE;*/
+    /*axis2_bool_t dropped = AXIS2_FALSE;*/
+    /*axutil_property_t *property = NULL;*/
     axiom_soap_envelope_t *soap_envelope = NULL;
     axiom_soap_fault_t *fault_part = NULL;
-    axis2_char_t *reinjected_msg = AXIS2_FALSE;
     const axutil_string_t *str_soap_action = NULL;
     const axis2_char_t *wsa_action = NULL;
     const axis2_char_t *soap_action = NULL;
     axis2_bool_t is_rm_global_msg = AXIS2_FALSE;
     sandesha2_msg_ctx_t *rm_msg_ctx = NULL;
-    /*axis2_bool_t dropped = AXIS2_FALSE;*/
     axis2_bool_t isolated_last_msg = AXIS2_FALSE;
-    axutil_property_t *property = NULL;
     AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,  
         "[sandesha2]Entry:sandesha2_global_in_handler");
@@ -180,7 +180,7 @@
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_CONF_CTX_NULL, 
AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    ctx = axis2_msg_ctx_get_base(msg_ctx, env);
+    /*ctx = axis2_msg_ctx_get_base(msg_ctx, env);
     if(!axis2_msg_ctx_get_server_side(msg_ctx, env))
     {
         axis2_ctx_t *conf_ctx_base = axis2_conf_ctx_get_base(conf_ctx, env);
@@ -188,7 +188,7 @@
             0, 0, NULL);
         axis2_ctx_set_property(conf_ctx_base, env, SANDESHA2_IS_SVR_SIDE, 
             property);
-    }
+    }*/
     
     soap_envelope = axis2_msg_ctx_get_soap_envelope(msg_ctx, env);
     if(!soap_envelope)
@@ -197,16 +197,16 @@
             "is NULL");
         return AXIS2_FAILURE;
     }
-    property = axis2_ctx_get_property(ctx, env, SANDESHA2_REINJECTED_MESSAGE);
+    /*property = axis2_ctx_get_property(ctx, env, 
SANDESHA2_REINJECTED_MESSAGE);
     if(property)
         reinjected_msg = (axis2_char_t *) axutil_property_get_value(property, 
env); 
     if(reinjected_msg && 0 == axutil_strcmp(AXIS2_VALUE_TRUE, reinjected_msg))
     {
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Detected"\
              " reinjected_msg. So return here.");
-        return AXIS2_SUCCESS; /* Reinjected Messages are not processed by 
-                                 sandesha2 inflow handlers */
-    }
+        return AXIS2_SUCCESS; // Reinjected Messages are not processed by 
+                                 sandesha2 inflow handlers
+    }*/
     /*if(!sandesha2_permanent_storage_mgr_create_db(env, conf_ctx))
         return AXIS2_FAILURE;*/
     fault_part = axiom_soap_body_get_fault(axiom_soap_envelope_get_body(

Modified: 
webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c?rev=614817&r1=614816&r2=614817&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c 
(original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c Thu 
Jan 24 00:18:35 2008
@@ -382,7 +382,7 @@
     axis2_transport_out_desc_t *transport_out_desc = NULL;
     axis2_endpoint_ref_t *endpoint_ref = NULL;
     axis2_op_t *op = NULL;
-    axis2_options_t *options = NULL;
+    /*axis2_options_t *options = NULL;*/
     axiom_xml_reader_t *reader = NULL;
     int soap_version = -1;
     axiom_stax_builder_t *om_builder = NULL;
@@ -577,12 +577,17 @@
         endpoint_ref = axis2_endpoint_ref_create(env, reply_to_str);
         axis2_msg_ctx_set_reply_to(msg_ctx, env, endpoint_ref);
     }
-    options = (axis2_options_t *) axis2_msg_ctx_get_options(msg_ctx, env);
+    /*options = (axis2_options_t *) axis2_msg_ctx_get_options(msg_ctx, env);
     if(options)
     {
         axis2_char_t *action = sandesha2_msg_store_bean_get_action(
             msg_store_bean, env);
                axis2_options_set_action(options, env, action);
+    }*/
+    {
+        axis2_char_t *action = sandesha2_msg_store_bean_get_action(
+            msg_store_bean, env);
+        axis2_msg_ctx_set_wsa_action(msg_ctx, env, action);
     }
     persistent_prop_str = 
         sandesha2_msg_store_bean_get_persistent_property_str(msg_store_bean, 
@@ -661,7 +666,7 @@
     axis2_char_t *address = NULL;
     axis2_char_t *action = NULL;
     axutil_property_t *property = NULL;
-    axis2_options_t *options = NULL;
+    /*axis2_options_t *options = NULL;*/
     axis2_char_t *prop_str = NULL;
     axis2_op_ctx_t *op_ctx = NULL;
     sandesha2_msg_store_bean_t *bean = NULL;
@@ -757,8 +762,9 @@
     if(transport_to)
         sandesha2_msg_store_bean_set_transport_to(bean, env, transport_to);
 
-    options = (axis2_options_t *) axis2_msg_ctx_get_options(msg_ctx, env);
-       action  = (axis2_char_t *) axis2_options_get_action(options, env);
+    /*options = (axis2_options_t *) axis2_msg_ctx_get_options(msg_ctx, env);
+       action  = (axis2_char_t *) axis2_options_get_action(options, env);*/
+    action = (axis2_char_t *) axis2_msg_ctx_get_wsa_action(msg_ctx, env);
     sandesha2_msg_store_bean_set_action(bean, env, action);
     prop_str = sandesha2_permanent_storage_mgr_get_property_string(env, 
msg_ctx);
     if (prop_str)
@@ -808,10 +814,11 @@
     axutil_property_t *property = NULL;
     axutil_hash_index_t *index = NULL;
        axutil_hash_t *properties = NULL;
-    axis2_options_t *options = (axis2_options_t *) axis2_msg_ctx_get_options(
+    /*axis2_options_t *options = (axis2_options_t *) axis2_msg_ctx_get_options(
         msg_ctx, env);
-       properties = axis2_options_get_properties(options, env);
-
+       properties = axis2_options_get_properties(options, env);*/
+    properties = axis2_ctx_get_property_map(axis2_msg_ctx_get_base(msg_ctx, 
+        env), env);
     property = axis2_msg_ctx_get_property(msg_ctx, env, 
         SANDESHA2_QUALIFIED_FOR_SENDING);
     if(property)

Modified: webservices/sandesha/trunk/c/src/util/fault_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/fault_mgr.c?rev=614817&r1=614816&r2=614817&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/fault_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/fault_mgr.c Thu Jan 24 00:18:35 2008
@@ -216,12 +216,25 @@
                 next_bean = axutil_array_list_get(list, env, i);
                 tmp_id = sandesha2_next_msg_bean_get_seq_id(
                     next_bean, env);
+                if(contains)
+                {
+                    if(next_bean)
+                        sandesha2_next_msg_bean_free(next_bean, env);
+                    continue;
+                }
                 if(0 == axutil_strcmp(seq_id, tmp_id))
                 {
+                    if(next_bean)
+                        sandesha2_next_msg_bean_free(next_bean, env);
                     contains = AXIS2_TRUE;
-                    break;
+                }
+                else
+                {
+                    if(next_bean)
+                        sandesha2_next_msg_bean_free(next_bean, env);
                 }
             }
+            axutil_array_list_free(list, env);
         }
         if(contains)
             valid_seq = AXIS2_TRUE;
@@ -251,6 +264,8 @@
                         rm_ns_val, SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
         detail_ele = axiom_element_create_with_qname(env, NULL, qname, 
                         &detail_node);
+        if(qname)
+            axutil_qname_free(qname, env);
         sandesha2_fault_data_set_detail(fault_data, env, detail_node);
         sandesha2_fault_data_set_reason(fault_data, env, "A sequence with the" 
\
                         " given sequenceID has NOT been established");
@@ -325,6 +340,8 @@
             NULL, NULL);
         detail_ele = axiom_element_get_first_child_with_qname(dummy_ele, env,
                         qname, dummy_node, &detail_node);
+        if(qname)
+            axutil_qname_free(qname, env);
         sandesha2_fault_data_set_detail(fault_data, env, detail_node);
         sandesha2_fault_data_set_reason(fault_data, env, reason);
         return sandesha2_fault_mgr_get_fault(env, ack_rm_msg, fault_data,

Modified: webservices/sandesha/trunk/c/src/util/msg_init.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/msg_init.c?rev=614817&r1=614816&r2=614817&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_init.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_init.c Thu Jan 24 00:18:35 2008
@@ -409,6 +409,7 @@
         {
             prop_key = axutil_strdup(env, 
sandesha2_seq_property_bean_get_value(
                     internal_seq_id_bean, env));
+            sandesha2_seq_property_bean_free(internal_seq_id_bean, env);
         }
     }
     rm_ns = sandesha2_msg_ctx_get_rm_ns_val(rm_msg_ctx, env);

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=614817&r1=614816&r2=614817&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Thu Jan 24 00:18:35 
2008
@@ -628,6 +628,8 @@
         
         svc_qname = axutil_qname_create(env, "AnonymousRMService", NULL, NULL);
         axis_svc = axis2_svc_create_with_qname(env, svc_qname);
+        if(svc_qname)
+            axutil_qname_free(svc_qname, env);
         
         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,
@@ -810,12 +812,16 @@
                         SANDESHA2_SPEC_2005_02_NS_URI, NULL);
         seq_element = axiom_element_get_first_child_with_qname(header_element, 
                         env, qname, header_node, &seq_node);
+        if(qname)
+            axutil_qname_free(qname, env);
         if(!seq_element)
         {
             qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_SEQ,
                         SANDESHA2_SPEC_2006_08_NS_URI, NULL);
             seq_element = axiom_element_get_first_child_with_qname(
                         header_element, env, qname, header_node, &seq_node);
+            if(qname)
+                axutil_qname_free(qname, env);
         }
     }
     if(seq_element)

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=614817&r1=614816&r2=614817&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/terminate_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/terminate_mgr.c Thu Jan 24 00:18:35 
2008
@@ -442,6 +442,8 @@
         sandesha2_seq_property_mgr_remove(seq_prop_mgr, env, 
                     sandesha2_seq_property_bean_get_seq_id(prop_bean, env),
                     name);
+        if(new_bean)
+            sandesha2_seq_property_bean_free(new_bean, env);
     }
     return AXIS2_SUCCESS;
 }



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

Reply via email to