Author: damitha
Date: Thu Jan 3 03:40:41 2008
New Revision: 608457
URL: http://svn.apache.org/viewvc?rev=608457&view=rev
Log:
Fixing memory leaks
Modified:
webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.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/app_msg_processor.c
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c
webservices/sandesha/trunk/c/src/storage/sqlite/permanent_sender_mgr.c
webservices/sandesha/trunk/c/src/util/ack_mgr.c
webservices/sandesha/trunk/c/src/util/terminate_mgr.c
webservices/sandesha/trunk/c/src/workers/in_order_invoker.c
webservices/sandesha/trunk/c/src/workers/sender_worker.c
webservices/sandesha/trunk/c/src/wsrm/last_msg.c
Modified: webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c?rev=608457&r1=608456&r2=608457&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c (original)
+++ webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c Thu Jan 3
03:40:41 2008
@@ -149,6 +149,7 @@
sandesha2_msg_processor_t *ack_proc = NULL;
ack_proc = sandesha2_ack_msg_processor_create(env);
sandesha2_msg_processor_process_in_msg(ack_proc, env, rm_msg_ctx);
+ sandesha2_msg_processor_free(ack_proc, env);
}
ack_requested = (sandesha2_ack_requested_t*)sandesha2_msg_ctx_get_msg_part(
rm_msg_ctx, env, SANDESHA2_MSG_PART_ACK_REQUEST);
@@ -163,7 +164,10 @@
if(msg_processor)
{
sandesha2_msg_processor_process_in_msg(msg_processor, env, rm_msg_ctx);
+ sandesha2_msg_processor_free(msg_processor, env);
}
+ if(rm_msg_ctx)
+ sandesha2_msg_ctx_free(rm_msg_ctx, env);
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[sandesha2]Exit:sandesha2_in_handler_invoke");
return AXIS2_SUCCESS;
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=608457&r1=608456&r2=608457&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
3 03:40:41 2008
@@ -211,6 +211,7 @@
if(msg_processor)
{
sandesha2_msg_processor_process_out_msg(msg_processor, env,
rm_msg_ctx);
+ sandesha2_msg_processor_free(msg_processor, env);
}
if(AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(env->error))
{
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=608457&r1=608456&r2=608457&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
3 03:40:41 2008
@@ -341,6 +341,8 @@
sandesha2_seq_property_mgr_update(seq_prop_mgr, env,
no_of_msgs_acked_bean);
}
+ if(no_of_msgs_acked_bean)
+ sandesha2_seq_property_bean_free(no_of_msgs_acked_bean, env);
completed_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr,
env, out_seq_id, SANDESHA2_SEQ_PROP_CLIENT_COMPLETED_MESSAGES);
if(!completed_bean && int_seq_id)
@@ -359,6 +361,8 @@
sandesha2_seq_property_bean_set_value(completed_bean, env, str_list);
sandesha2_seq_property_mgr_update(seq_prop_mgr, env, completed_bean);
}
+ if(str_list)
+ AXIS2_FREE(env->allocator, str_list);
last_out_msg_no_str = sandesha2_utils_get_seq_property(env, int_seq_id,
SANDESHA2_SEQ_PROP_LAST_OUT_MESSAGE_NO, seq_prop_mgr);
if(last_out_msg_no_str)
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=608457&r1=608456&r2=608457&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
3 03:40:41 2008
@@ -138,7 +138,6 @@
const axutil_env_t *env)
{
sandesha2_app_msg_processor_impl_t *msg_proc_impl = NULL;
- AXIS2_ENV_CHECK(env, NULL);
msg_proc_impl = (sandesha2_app_msg_processor_impl_t *)AXIS2_MALLOC
(env->allocator,
@@ -176,7 +175,6 @@
const axutil_env_t *env)
{
sandesha2_app_msg_processor_impl_t *msg_proc_impl = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
msg_proc_impl = SANDESHA2_INTF_TO_IMPL(msg_processor);
if(msg_processor->ops)
@@ -659,7 +657,8 @@
/* saving the property. */
sandesha2_seq_property_bean_set_value(incoming_seq_list_bean,
env, str_seq_list);
- AXIS2_FREE(env->allocator, str_seq_list);
+ if(str_seq_list)
+ AXIS2_FREE(env->allocator, str_seq_list);
sandesha2_seq_property_mgr_update(seq_prop_mgr, env,
incoming_seq_list_bean);
}
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=608457&r1=608456&r2=608457&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 3 03:40:41 2008
@@ -310,11 +310,11 @@
}
create_seq_storage_key = sandesha2_sender_bean_get_msg_ctx_ref_key(
create_seq_sender_bean, env);
+ sandesha2_storage_mgr_remove_msg_ctx(storage_mgr, env,
+ create_seq_storage_key, conf_ctx);
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);
out_seq_bean = sandesha2_seq_property_bean_create_with_data(env,
internal_seq_id,
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=608457&r1=608456&r2=608457&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 Thu
Jan 3 03:40:41 2008
@@ -643,6 +643,7 @@
for(i = 0; i < size; i++)
{
sandesha2_sender_bean_t *bean = NULL;
+ axis2_bool_t do_free = AXIS2_TRUE;
int msg_type = -1;
bean = (sandesha2_sender_bean_t *) axutil_array_list_get(match_list,
env, i);
@@ -656,14 +657,21 @@
if(result)
result_msg_no = sandesha2_sender_bean_get_msg_no(result, env);
if(result == NULL || result_msg_no > msg_no)
+ {
result = bean;
+ do_free = AXIS2_FALSE;
+ }
}
else if(!result)
{
result = bean;
- break;
+ do_free = AXIS2_FALSE;
}
+ if(bean && do_free)
+ sandesha2_sender_bean_free((sandesha2_rm_bean_t *)bean, env);
}
+ if(match_list)
+ axutil_array_list_free(match_list, env);
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[sandesha2]Exit:sandesha2_"\
"permanent_sender_mgr_get_next_msg_to_send");
return result;
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=608457&r1=608456&r2=608457&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/ack_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/ack_mgr.c Thu Jan 3 03:40:41 2008
@@ -274,6 +274,8 @@
return AXIS2_TRUE;
start = sandesha2_ack_range_get_upper_value(ack_range, env) + 1;
}
+ if(hash)
+ axutil_hash_free(hash, env);
return AXIS2_FALSE;
}
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=608457&r1=608456&r2=608457&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/terminate_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/terminate_mgr.c Thu Jan 3 03:40:41
2008
@@ -324,6 +324,8 @@
all_seq_str = sandesha2_utils_array_list_to_string(env,
all_seq_list,
SANDESHA2_ARRAY_LIST_STRING);
sandesha2_seq_property_bean_set_value(all_seq_bean, env,
all_seq_str);
+ if(all_seq_str)
+ AXIS2_FREE(env->allocator, all_seq_str);
sandesha2_seq_property_mgr_update(seq_prop_mgr, env, all_seq_bean);
}
}
@@ -550,7 +552,7 @@
internal_seq_id = sandesha2_utils_get_seq_property(env, seq_id,
SANDESHA2_SEQ_PROP_INTERNAL_SEQ_ID, seq_prop_mgr);
if(!internal_seq_id)
- internal_seq_id = seq_id;
+ internal_seq_id = axutil_strdup(env, seq_id);
found_list = sandesha2_sender_mgr_find_by_internal_seq_id(sender_mgr, env,
internal_seq_id);
if(found_list)
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=608457&r1=608456&r2=608457&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 3
03:40:41 2008
@@ -321,6 +321,7 @@
SANDESHA2_ARRAY_LIST_STRING);
sandesha2_seq_property_bean_set_value(all_seq_bean, env,
str_list);
+ AXIS2_FREE(env->allocator, str_list);
sandesha2_seq_property_mgr_update(seq_prop_mgr, env,
all_seq_bean);
continue;
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=608457&r1=608456&r2=608457&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender_worker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender_worker.c Thu Jan 3
03:40:41 2008
@@ -524,7 +524,7 @@
else
axis2_engine_receive(engine, env, res_msg_ctx);
}
- /* To avoid a second passing through incoming handlers at mep_client*/
+ /* To avoid a second passing through incoming handlers at op_client*/
property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_TRUE);
axis2_msg_ctx_set_property(msg_ctx, env, AXIS2_HANDLER_ALREADY_VISITED,
property);
Modified: webservices/sandesha/trunk/c/src/wsrm/last_msg.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/wsrm/last_msg.c?rev=608457&r1=608456&r2=608457&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/wsrm/last_msg.c (original)
+++ webservices/sandesha/trunk/c/src/wsrm/last_msg.c Thu Jan 3 03:40:41 2008
@@ -158,24 +158,25 @@
last_msg_impl = SANDESHA2_INTF_TO_IMPL(last_msg);
om_element = axiom_node_get_data_element(om_node, env);
- if(NULL == om_element)
+ if(!om_element)
{
AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT,
- AXIS2_FAILURE);
+ AXIS2_FAILURE);
return NULL;
}
lm_qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_LAST_MSG,
- last_msg_impl->ns_val, NULL);
- if(NULL == lm_qname)
+ last_msg_impl->ns_val, NULL);
+ if(!lm_qname)
{
return NULL;
}
lm_part = axiom_element_get_first_child_with_qname(om_element, env,
- lm_qname, om_node, &lm_node);
- if(NULL == lm_part)
+ lm_qname, om_node, &lm_node);
+ axutil_qname_free(lm_qname, env);
+ if(!lm_part)
{
AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT,
- AXIS2_FAILURE);
+ AXIS2_FAILURE);
return NULL;
}
return last_msg;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]