Author: damitha
Date: Thu Jan 24 10:08:31 2008
New Revision: 614948

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

Modified:
    webservices/sandesha/trunk/c/src/client/client.c
    webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c
    webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c
    webservices/sandesha/trunk/c/src/msgprocessors/ack_req_msg_processor.c
    webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
    webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c
    webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c
    
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/msgprocessors/terminate_seq_msg_processor.c
    
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_res_msg_processor.c
    webservices/sandesha/trunk/c/src/polling/polling_mgr.c
    webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c
    webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c
    webservices/sandesha/trunk/c/src/util/msg_creator.c
    webservices/sandesha/trunk/c/src/util/msg_init.c
    webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
    webservices/sandesha/trunk/c/src/workers/in_order_invoker.c
    webservices/sandesha/trunk/c/src/workers/sender.c
    webservices/sandesha/trunk/c/src/workers/sender_worker.c

Modified: webservices/sandesha/trunk/c/src/client/client.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/client/client.c?rev=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/client/client.c (original)
+++ webservices/sandesha/trunk/c/src/client/client.c Thu Jan 24 10:08:31 2008
@@ -248,8 +248,6 @@
     storage_mgr = sandesha2_utils_get_storage_mgr(env, dbname);
     seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname); 
     create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname); 
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     ctx = axis2_conf_ctx_get_base(conf_ctx, env);
     sandesha2_seq_report_set_internal_seq_id(seq_report, env, internal_seq_id);
     create_seq_find_bean = sandesha2_create_seq_bean_create(env);
@@ -416,8 +414,6 @@
     {
         seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, 
dbname);
     }
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     sandesha2_report = sandesha2_report_create(env);
     internal_seq_find_bean = sandesha2_seq_property_bean_create(env);
     ctx = axis2_conf_ctx_get_base(conf_ctx, env);
@@ -662,9 +658,11 @@
     node = axiom_soap_body_get_base_node(body, env);
     element = axiom_node_get_data_element(node, env);
     qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_TERMINATE_SEQ, 
-            rm_namespc_value, NULL);
+        rm_namespc_value, NULL);
     terminate_body_element = axiom_element_get_first_child_with_qname(element, 
         env, qname, node, &terminate_body_node);
+    if(qname)
+        axutil_qname_free(qname, env);
     old_action = axutil_strdup(env, axis2_options_get_action(options, env));
     action = sandesha2_spec_specific_consts_get_terminate_seq_action(env, 
             rm_spec_version);
@@ -741,7 +739,7 @@
     if(!svc_ctx)
     {
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SVC_CTX_NULL, 
-                AXIS2_FAILURE);
+            AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
 
@@ -749,11 +747,11 @@
     if(!options)
     {
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_OPTIONS_OBJECT_NOT_SET, 
-                AXIS2_FAILURE);
+            AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
     property = (axutil_property_t *) axis2_options_get_property(options, env, 
-            SANDESHA2_CLIENT_RM_SPEC_VERSION);
+        SANDESHA2_CLIENT_RM_SPEC_VERSION);
     if(property)
         rm_spec_version = axutil_property_get_value(property, env);
     if(!rm_spec_version)
@@ -762,7 +760,7 @@
             sandesha2_spec_specific_consts_get_default_spec_version(env);
     }
     rm_namespc_value = sandesha2_spec_specific_consts_get_rm_ns_val(env, 
-            rm_spec_version);
+        rm_spec_version);
     conf_ctx =  axis2_svc_ctx_get_conf_ctx(svc_ctx, env);
     close_envelope = sandesha2_client_configure_close_seq(env, options, 
             conf_ctx);
@@ -770,20 +768,22 @@
     node = axiom_soap_body_get_base_node(body, env);
     element = axiom_node_get_data_element(node, env);
     qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_CLOSE_SEQ, 
-            rm_namespc_value, NULL);
+        rm_namespc_value, NULL);
     close_body_element = axiom_element_get_first_child_with_qname(element, 
env, 
-            qname, node, &close_body_node);
+        qname, node, &close_body_node);
+    if(qname)
+        axutil_qname_free(qname, env);
     old_action = (axis2_char_t*)axis2_options_get_action(options, env);
     action = sandesha2_spec_specific_consts_get_close_seq_action(env, 
-            rm_spec_version);
+        rm_spec_version);
     axis2_options_set_action(options, env, action);
 
     axis2_svc_client_fire_and_forget(svc_client, env, close_body_node);
     if(AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(env->error))
     {
         AXIS2_ERROR_SET(env->error, 
-                SANDESHA2_ERROR_COULD_NOT_SEND_THE_CLOSE_SEQ_MESSAGE, 
-                AXIS2_FAILURE);
+            SANDESHA2_ERROR_COULD_NOT_SEND_THE_CLOSE_SEQ_MESSAGE, 
+            AXIS2_FAILURE);
         axis2_options_set_action(options, env, old_action);
         return AXIS2_FAILURE;
     }
@@ -1010,8 +1010,6 @@
     dbname = sandesha2_util_get_dbname(env, conf_ctx);
     storage_mgr = sandesha2_utils_get_storage_mgr(env, dbname);
     seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     seq_id_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, 
             internal_seq_id, SANDESHA2_SEQ_PROP_OUT_SEQ_ID);
     if(!seq_id_bean)
@@ -1067,7 +1065,7 @@
     if(!options)
     {
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_OPTIONS_OBJECT_NOT_SET, 
-                AXIS2_FAILURE);
+            AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
     svc_ctx = (axis2_svc_ctx_t *) axis2_svc_client_get_svc_ctx(svc_client, 
env);
@@ -1081,7 +1079,7 @@
     if(!to_epr)
     {
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_TO_EPR_NOT_SET, 
-                AXIS2_FAILURE);
+            AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
     to = (axis2_char_t*)axis2_endpoint_ref_get_address(to_epr, env);
@@ -1099,7 +1097,7 @@
     if(0  == axutil_strcmp(rm_spec_version, SANDESHA2_SPEC_VERSION_1_0))
     {
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_EMPTY_ACK_REQUEST_MESSAGE, 
-                AXIS2_FAILURE);
+            AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
     internal_seq_id = sandesha2_client_get_internal_seq_id(env, to, seq_key);
@@ -1108,16 +1106,16 @@
     if(!seq_report)
     {
         AXIS2_ERROR_SET(env->error, 
-                
SANDESHA2_ERROR_CANNOT_GENERATE_SEQ_REPORT_FOR_GIVEN_INTERNAL_SEQ_ID, 
-                AXIS2_FAILURE);
+            
SANDESHA2_ERROR_CANNOT_GENERATE_SEQ_REPORT_FOR_GIVEN_INTERNAL_SEQ_ID, 
+            AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
     status = sandesha2_seq_report_get_seq_status(seq_report, env);
     if(status != SANDESHA2_SEQ_STATUS_ESTABLISHED)
     {
         AXIS2_ERROR_SET(env->error, 
-                
SANDESHA2_ERROR_CANNOT_SEND_ACK_REQUEST_MESSAGE_SINCE_IS_NOT_ACTIVE, 
-                AXIS2_FAILURE);
+            
SANDESHA2_ERROR_CANNOT_SEND_ACK_REQUEST_MESSAGE_SINCE_IS_NOT_ACTIVE, 
+            AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
     out_seq_id = sandesha2_client_get_seq_id(env, svc_client);
@@ -1130,7 +1128,7 @@
     else
     {
         dummy_envelope = axiom_soap_envelope_create_default_soap_envelope(env, 
-                AXIOM_SOAP12); 
+            AXIOM_SOAP12); 
     }
     rm_ns_value = sandesha2_spec_specific_consts_get_rm_ns_val(env, 
rm_spec_version);
     ack_requested = sandesha2_ack_requested_create(env, rm_ns_value);
@@ -1142,12 +1140,14 @@
     node = axiom_soap_header_get_base_node(header, env);
     element = axiom_node_get_data_element(node, env);
     qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_ACK_REQUESTED, 
-            rm_ns_value, NULL);
+        rm_ns_value, NULL);
     ack_requested_header_block = axiom_element_get_first_child_with_qname(
             element, env, qname, node, &ack_requested_header_block_node);
+    if(qname)
+        axutil_qname_free(qname, env);
     old_action = (axis2_char_t*)axis2_options_get_action(options, env);
     action = sandesha2_spec_specific_consts_get_ack_req_action(env, 
-            rm_spec_version);
+        rm_spec_version);
     axis2_options_set_action(options, env, action);
     axis2_svc_client_add_header(svc_client, env, 
ack_requested_header_block_node); 
     axis2_svc_client_fire_and_forget(svc_client, env, NULL);
@@ -1263,8 +1263,6 @@
     dbname = sandesha2_util_get_dbname(env, conf_ctx);
     storage_mgr = sandesha2_utils_get_storage_mgr(env, dbname);
     seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     seq_id_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, 
             internal_seq_id, SANDESHA2_SEQ_PROP_OUT_SEQ_ID);
     if(!seq_id_bean)
@@ -1591,8 +1589,6 @@
     storage_mgr = sandesha2_utils_get_storage_mgr(env, dbname);
     seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname); 
     next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(env, dbname); 
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     ctx = axis2_conf_ctx_get_base(conf_ctx, env);
     seq_report = sandesha2_seq_report_create(env);
     completed_msg_list = sandesha2_ack_mgr_get_svr_completed_msgs_list(env, 
@@ -1702,8 +1698,6 @@
         {
             seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, 
dbname);
         }
-        if(dbname)
-            AXIS2_FREE(env->allocator, dbname);
         if(seq_prop_mgr)
             seq_id_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, 
env, 
                 internal_seq_id, SANDESHA2_SEQ_PROP_OUT_SEQ_ID);
@@ -1801,7 +1795,9 @@
     msg_ctx = axis2_msg_ctx_create(env, conf_ctx, NULL, NULL);
     svc = axis2_svc_client_get_svc(svc_client, env);
     op = axis2_svc_get_op_with_qname(svc, env,
-            op_qname);
+        op_qname);
+    if(op_qname)
+        axutil_qname_free(op_qname, env);
     op_client = axis2_op_client_create(env, op, svc_ctx, options);
     if (!op_client)
     {
@@ -1857,6 +1853,8 @@
     msg_ctx = axis2_msg_ctx_create(env, conf_ctx, NULL, NULL);
        svc = axis2_svc_client_get_svc(svc_client, env);
     op = axis2_svc_get_op_with_qname(svc, env, op_qname);
+    if(op_qname)
+        axutil_qname_free(op_qname, env);
     if (!fill_soap_envelope(env, msg_ctx, options, payload))
     {
         return;
@@ -1977,8 +1975,6 @@
     conf = axis2_conf_ctx_get_conf(conf_ctx, env);
     dbname = sandesha2_util_get_dbname(env, conf_ctx);
     storage_mgr = sandesha2_utils_get_storage_mgr(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     ctx = axis2_conf_ctx_get_base(conf_ctx, env);
     response_envelope = sandesha2_storage_mgr_retrieve_response(storage_mgr, 
env, 
         client_seq_key, msg_no);

Modified: webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c?rev=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c (original)
+++ webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c Thu Jan 
24 10:08:31 2008
@@ -104,11 +104,14 @@
     module_qname = axutil_qname_create(env, SANDESHA2_MODULE, NULL, NULL);
     if(!axis2_svc_is_module_engaged(svc, env, module_qname))
     {
+        if(module_qname)
+            axutil_qname_free(module_qname, env);
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
             "[sandesha2]RM is not engaged. So return here");
         return AXIS2_SUCCESS;
     }
-    axutil_qname_free(module_qname, env);
+    if(module_qname)
+        axutil_qname_free(module_qname, 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);

Modified: webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c?rev=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c Thu Jan 
24 10:08:31 2008
@@ -195,8 +195,6 @@
     create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname);
     sender_mgr = sandesha2_permanent_sender_mgr_create(env, dbname);
     next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(env,dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     
     ack_range_list = sandesha2_seq_ack_get_ack_range_list(seq_ack, env);
     nack_list = sandesha2_seq_ack_get_nack_list(seq_ack, env);

Modified: webservices/sandesha/trunk/c/src/msgprocessors/ack_req_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/ack_req_msg_processor.c?rev=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/ack_req_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/ack_req_msg_processor.c Thu 
Jan 24 10:08:31 2008
@@ -191,8 +191,6 @@
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2]acks_to_str"\
             " seqeunce property is not set correctly");
-        if(dbname)
-            AXIS2_FREE(env->allocator, dbname);
         if(seq_prop_mgr)
             sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
         if(storage_mgr)
@@ -286,8 +284,6 @@
                 axis2_engine_free(engine, env);
                 engine = NULL;
             }
-            if(dbname)
-                AXIS2_FREE(env->allocator, dbname);
             if(seq_prop_mgr)
                 sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
             if(storage_mgr)
@@ -400,8 +396,6 @@
                 AXIS2_FAILURE);
             if(engine)
                 axis2_engine_free(engine, env);
-            if(dbname)
-                AXIS2_FREE(env->allocator, dbname);
             if(seq_prop_mgr)
                 sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
             if(sender_mgr)
@@ -417,8 +411,6 @@
         if(sender_mgr)
             sandesha2_sender_mgr_free(sender_mgr, env);
     }
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     if(seq_prop_mgr)
         sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
     if(storage_mgr)

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=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Thu Jan 
24 10:08:31 2008
@@ -286,8 +286,6 @@
                 sandesha2_msg_ctx_free(fault_ctx, env);
             if(engine)
                 axis2_engine_free(engine, env);
-            if(dbname)
-                AXIS2_FREE(env->allocator, dbname);
             if(storage_mgr)
                 sandesha2_storage_mgr_free(storage_mgr, env);
             return AXIS2_FAILURE;
@@ -297,8 +295,6 @@
         if(engine)
             axis2_engine_free(engine, env);
         axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_TRUE);
-        if(dbname)
-            AXIS2_FREE(env->allocator, dbname);
         if(storage_mgr)
             sandesha2_storage_mgr_free(storage_mgr, env);
         return AXIS2_SUCCESS;
@@ -307,8 +303,6 @@
     create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname);
     next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(env, dbname);
     invoker_mgr = sandesha2_permanent_invoker_mgr_create(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     seq = sandesha2_msg_ctx_get_sequence(rm_msg_ctx, env);
     sandesha2_seq_set_must_understand(seq, env, AXIS2_FALSE);
     str_seq_id = sandesha2_identifier_get_identifier(
@@ -861,16 +855,12 @@
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
             "[sandesha2]seq_prop_mgr is NULL");
-        if(dbname)
-            AXIS2_FREE(env->allocator, dbname);
         if(storage_mgr)
             sandesha2_storage_mgr_free(storage_mgr, env);
         return AXIS2_FAILURE;
     }
     create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname);
     sender_mgr = sandesha2_permanent_sender_mgr_create(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     is_svr_side = axis2_msg_ctx_get_server_side(msg_ctx, env);
     
     to_epr = axis2_msg_ctx_get_to(msg_ctx, env);

Modified: 
webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c?rev=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/close_seq_msg_processor.c 
Thu Jan 24 10:08:31 2008
@@ -166,8 +166,6 @@
     seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
     create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname);
     next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     close_seq = sandesha2_msg_ctx_get_close_seq(rm_msg_ctx, env);
     
     seq_id = sandesha2_identifier_get_identifier(

Modified: 
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c?rev=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c 
Thu Jan 24 10:08:31 2008
@@ -191,8 +191,6 @@
     seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
     create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname);
     next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     
     fault_rm_msg_ctx = sandesha2_fault_mgr_check_for_create_seq_refused(
         env, msg_ctx, seq_prop_mgr);

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=614948&r1=614947&r2=614948&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 
Thu Jan 24 10:08:31 2008
@@ -209,8 +209,6 @@
             "[sandesha2]Create Sequence Response part is null");
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_REQD_MSG_PART_MISSING,
             AXIS2_FAILURE);
-        if(dbname)
-            AXIS2_FREE(env->allocator, dbname);
         if(storage_mgr)
             sandesha2_storage_mgr_free(storage_mgr, env);
         return AXIS2_FAILURE;
@@ -224,8 +222,6 @@
             "[sandesha2]New sequence id is null");
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_CANNOT_FIND_SEQ_ID,
             AXIS2_FAILURE);
-        if(dbname)
-            AXIS2_FREE(env->allocator, dbname);
         if(storage_mgr)
             sandesha2_storage_mgr_free(storage_mgr, env);
         return AXIS2_FAILURE;
@@ -237,8 +233,6 @@
             " sequence message. relates_to part is not available");
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_INVALID_RELATES_TO,
             AXIS2_FAILURE);
-        if(dbname)
-            AXIS2_FREE(env->allocator, dbname);
         if(storage_mgr)
             sandesha2_storage_mgr_free(storage_mgr, env);
         return AXIS2_FAILURE;
@@ -253,8 +247,6 @@
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
             "[sandesha2]Create Sequence entry not found");
-        if(dbname)
-            AXIS2_FREE(env->allocator, dbname);
         if(seq_prop_mgr)
             sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
         if(create_seq_mgr)
@@ -273,8 +265,6 @@
             "[sandesha2]Internal sequence id is not set");
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_CANNOT_FIND_SEQ_ID,
             AXIS2_FAILURE);
-        if(dbname)
-            AXIS2_FREE(env->allocator, dbname);
         if(seq_prop_mgr)
             sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
         if(create_seq_mgr)
@@ -294,8 +284,6 @@
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
             "[sandesha2]Create sequence entry not found");
-        if(dbname)
-            AXIS2_FREE(env->allocator, dbname);
         if(seq_prop_mgr)
             sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
         if(create_seq_mgr)
@@ -348,8 +336,6 @@
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
                 "[sandesha2]No offered sequence entry. But an accept was 
received");
-            if(dbname)
-                AXIS2_FREE(env->allocator, dbname);
             if(seq_prop_mgr)
                 sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
             if(create_seq_mgr)
@@ -422,8 +408,6 @@
             {
                 AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
                     "[sandesha2]to_seq_bean is NULL");
-                if(dbname)
-                    AXIS2_FREE(env->allocator, dbname);
                 if(seq_prop_mgr)
                     sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
                 if(create_seq_mgr)
@@ -479,8 +463,6 @@
         if(next_msg_mgr)
             sandesha2_next_msg_mgr_free(next_msg_mgr, env);
     }
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     target_bean = sandesha2_sender_bean_create(env);
     sandesha2_sender_bean_set_internal_seq_id(target_bean, env, 
internal_seq_id);
     sandesha2_sender_bean_set_send(target_bean, env, AXIS2_FALSE);

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=614948&r1=614947&r2=614948&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 
Thu Jan 24 10:08:31 2008
@@ -219,8 +219,6 @@
         create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, 
dbname);
         sender_mgr = sandesha2_permanent_sender_mgr_create(env, dbname);
     }
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     int_seq_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, 
         seq_id, SANDESHA2_SEQ_PROP_INTERNAL_SEQ_ID);
     if(int_seq_bean)

Modified: 
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c?rev=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- 
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c 
(original)
+++ 
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c 
Thu Jan 24 10:08:31 2008
@@ -218,8 +218,6 @@
     create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname);
     sender_mgr = sandesha2_permanent_sender_mgr_create(env, dbname);
     next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     fault_ctx = sandesha2_fault_mgr_check_for_unknown_seq(env, 
         rm_msg_ctx, seq_id, seq_prop_mgr, create_seq_mgr, next_msg_mgr);
     if(fault_ctx)
@@ -564,8 +562,6 @@
     seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
     create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname);
     sender_mgr = sandesha2_permanent_sender_mgr_create(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     to_address = (axis2_char_t*)axis2_endpoint_ref_get_address(
         axis2_msg_ctx_get_to(msg_ctx, env), env);
     property = axis2_msg_ctx_get_property(msg_ctx, env, 
SANDESHA2_CLIENT_SEQ_KEY);
@@ -594,9 +590,10 @@
         SANDESHA2_SEQ_PROP_TERMINATE_ADDED, seq_prop_mgr);
     old_op = axis2_msg_ctx_get_op(msg_ctx, env);
     
-    qname = axutil_qname_create(env, "temp", NULL, NULL);
-    
+    qname = axutil_qname_create(env, "temp", NULL, NULL); 
     out_in_op = axis2_op_create_with_qname(env, qname);
+    if(qname)
+        axutil_qname_free(qname, env);
     axis2_op_set_msg_exchange_pattern(out_in_op, env, AXIS2_MEP_URI_OUT_IN);
     axis2_op_set_in_flow(out_in_op, env, 
          axis2_op_get_in_flow(old_op, env));

Modified: 
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_res_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_res_msg_processor.c?rev=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- 
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_res_msg_processor.c
 (original)
+++ 
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_res_msg_processor.c
 Thu Jan 24 10:08:31 2008
@@ -164,8 +164,6 @@
     seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
     create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname);
     sender_mgr =sandesha2_permanent_sender_mgr_create(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     /* We need to pass here internal seq id isn't it?:damitha
     int internal_seq_id = sandesha2_utils_get_seq_property(env, seq_id, 
         SANDESHA2_SEQ_PROP_INTERNAL_SEQ_ID, storage_mgr);*/

Modified: webservices/sandesha/trunk/c/src/polling/polling_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/polling/polling_mgr.c?rev=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/polling/polling_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/polling/polling_mgr.c Thu Jan 24 10:08:31 
2008
@@ -174,8 +174,6 @@
     }
     dbname = sandesha2_util_get_dbname(env, conf_ctx);
     storage_mgr = sandesha2_utils_get_storage_mgr(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     sandesha2_polling_mgr_set_poll(polling_mgr, env, AXIS2_TRUE);
     sandesha2_polling_mgr_schedule_polling_request(polling_mgr, env, 
         internal_seq_id);
@@ -236,8 +234,6 @@
     seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
     sender_mgr = sandesha2_permanent_sender_mgr_create(env, dbname);
     next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
 
     while(polling_mgr->poll)
     {
@@ -274,7 +270,8 @@
         {
             wait_time = AXIS2_ATOI(axutil_param_get_value(wait_time_param, 
env));
         }
-        axutil_qname_free(qname, env);
+        if(qname)
+            axutil_qname_free(qname, env);
         AXIS2_SLEEP(wait_time);
          /* Getting the sequences to be polled. if schedule contains any 
requests, 
           * do the earliest one. else pick one randomly.

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=614948&r1=614947&r2=614948&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 10:08:31 2008
@@ -496,6 +496,8 @@
             axutil_qname_t *op_qname = axutil_qname_create_from_string(env, 
                 op_name_str);
             op = axis2_svc_get_op_with_qname(svc, env, op_qname);
+            if(op_qname)
+                axutil_qname_free(op_qname, env);
         }
         if(!op && op_mep_str && svc)
         {
@@ -1058,8 +1060,6 @@
         system(permission_str);
     }
     #endif
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     sql_stmt1 = "create table create_seq("\
         "create_seq_msg_id varchar(100) primary key, "\
         "internal_seq_id varchar(200), seq_id varchar(200), "\

Modified: 
webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c?rev=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c 
(original)
+++ webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c Thu 
Jan 24 10:08:31 2008
@@ -184,8 +184,6 @@
     conf = axis2_conf_ctx_get_conf(conf_ctx, env);
     dbname = sandesha2_util_get_dbname(env, conf_ctx);
     storage_mgr = sandesha2_utils_get_storage_mgr(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     
     property = axutil_property_create_with_args(env, 0, 0, 0, 
AXIS2_VALUE_TRUE);
     axis2_msg_ctx_set_property(msg_ctx, env, SANDESHA2_QUALIFIED_FOR_SENDING,

Modified: webservices/sandesha/trunk/c/src/util/msg_creator.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/msg_creator.c?rev=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_creator.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_creator.c Thu Jan 24 10:08:31 2008
@@ -127,7 +127,8 @@
      */
     qname = axutil_qname_create(env, "CreateSequenceOperation", NULL, NULL);
     create_seq_op = axis2_op_create_with_qname(env, qname);
-    axutil_qname_free(qname, env);
+    if(qname)
+        axutil_qname_free(qname, env);
 
     create_seq_msg_ctx = sandesha2_utils_create_new_related_msg_ctx(env, 
             application_rm_msg, create_seq_op);
@@ -994,7 +995,8 @@
     }
     qname = axutil_qname_create(env, "MakeConnectionOperation", NULL, NULL);
     make_conn_op = axis2_op_create_with_qname(env, qname);
-    axutil_qname_free(qname, env);
+    if(qname)
+        axutil_qname_free(qname, env);
     make_conn_msg_ctx = sandesha2_utils_create_new_related_msg_ctx(env, 
         ref_rm_msg_ctx, make_conn_op);
     if(make_conn_msg_ctx)

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=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_init.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_init.c Thu Jan 24 10:08:31 2008
@@ -280,8 +280,6 @@
     conf_ctx = axis2_msg_ctx_get_conf_ctx(temp_msg_ctx, env);
     dbname = sandesha2_util_get_dbname(env, conf_ctx);
     seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     create_seq = sandesha2_msg_ctx_get_create_seq(rm_msg_ctx, env);
     create_seq_res = sandesha2_msg_ctx_get_create_seq_res(rm_msg_ctx, env);
     terminate_seq = sandesha2_msg_ctx_get_terminate_seq(rm_msg_ctx, env);
@@ -474,11 +472,11 @@
             "[sandesha2]Message context operation is NULL. So adding default "\
             "operation");
         tmp_qname = axutil_qname_create(env, "__OPERATION_OUT_IN__", NULL, 
-                NULL);
+            NULL);
         if (!tmp_qname)
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, 
-                    AXIS2_FAILURE);
+                AXIS2_FAILURE);
             return;
         }
         svc = axis2_msg_ctx_get_svc(msg_ctx, env);
@@ -513,7 +511,8 @@
                 op = NULL;
             }
         }
-        axutil_qname_free(tmp_qname, env);
+        if(tmp_qname)
+            axutil_qname_free(tmp_qname, env);
         axis2_msg_ctx_set_op(msg_ctx, env, op);
     }
 }

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=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Thu Jan 24 10:08:31 
2008
@@ -1417,10 +1417,11 @@
         dbparam = axis2_module_desc_get_param(module_desc, env, SANDESHA2_DB);
         if(dbparam)
         {
-            dbname = axutil_strdup(env, axutil_param_get_value(dbparam, env));
+            dbname = axutil_param_get_value(dbparam, env);
         }
     }
-    axutil_qname_free(qname, env);
+    if(qname)
+        axutil_qname_free(qname, env);
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "dbname:%s", dbname);
     return dbname;
 }

Modified: webservices/sandesha/trunk/c/src/workers/in_order_invoker.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/in_order_invoker.c?rev=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/in_order_invoker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/in_order_invoker.c Thu Jan 24 
10:08:31 2008
@@ -262,8 +262,6 @@
     seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
     next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(env, dbname);
     invoker_mgr = sandesha2_permanent_invoker_mgr_create(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
     while(invoker->run_invoker)
     {
         sandesha2_seq_property_bean_t *all_seq_bean = NULL;

Modified: webservices/sandesha/trunk/c/src/workers/sender.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/sender.c?rev=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender.c Thu Jan 24 10:08:31 2008
@@ -137,8 +137,6 @@
     seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
     create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname);
     sender_mgr = sandesha2_permanent_sender_mgr_create(env, dbname);
-    if(dbname)
-        AXIS2_FREE(env->allocator, dbname);
 
     qname = axutil_qname_create(env, SANDESHA2_MODULE, NULL, NULL);
     module_desc = axis2_conf_get_module(conf, env, qname);
@@ -149,7 +147,8 @@
         sleep_time = AXIS2_ATOI(axutil_param_get_value(sleep_time_param, 
             env));
     }
-    axutil_qname_free(qname, env);
+    if(qname)
+        axutil_qname_free(qname, env);
     while(run_sender)
     {
         sandesha2_sender_bean_t *sender_bean = NULL;

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=614948&r1=614947&r2=614948&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender_worker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender_worker.c Thu Jan 24 
10:08:31 2008
@@ -526,6 +526,8 @@
                 axutil_qname_t *op_qname = 
axutil_qname_create_from_string(env, 
                     op_name_str);
                 op = axis2_svc_get_op_with_qname(svc, env, op_qname);
+                if(op_qname)
+                    axutil_qname_free(op_qname, env);
             }
             if(!op && op_mep_str && svc)
             {



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

Reply via email to