[ 
http://issues.apache.org/jira/browse/AXIS2C-387?page=comments#action_12447375 ] 
            
Damitha Kumarage commented on AXIS2C-387:
-----------------------------------------

It may be true that this code block is causing memory leaks. But it has a 
meaning. If you see more carefully this is how message out and message 
processing phases are added as operation specific phases. I don't see these 
phases are used anywhere in our code. If we are never going to use these then 
it is reasonable to remove this code block. Otherwise memory leak has to be 
fixed

> Memory leaks in operation caused by code blocks with no meaning
> ---------------------------------------------------------------
>
>                 Key: AXIS2C-387
>                 URL: http://issues.apache.org/jira/browse/AXIS2C-387
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/description
>    Affects Versions: 0.95
>            Reporter: Samisa Abeysinghe
>            Priority: Trivial
>
> The following code blocks in op.c makes no sence, they are not needed and 
> causes memory leaks as well.
> As you may notice, the phase created is added to a list, which is a local 
> variable that is never used. 
> Hence the code does infact do nothing.
> message_processing = axis2_phase_create(env, AXIS2_PHASE_MESSAGE_PROCESSING);
>     if (op_impl->base)
>     {
>         axis2_msg_t *msg = NULL;
>         msg = AXIS2_DESC_GET_CHILD(op_impl->base, env, AXIS2_MSG_IN);
>         if (msg)
>         {
>             axis2_array_list_t *list = AXIS2_MSG_GET_FLOW(msg, env);
>             if (list)
>             {
>                 status = AXIS2_ARRAY_LIST_ADD(list, env,
>                         message_processing);
>             }
>             else
>             {
>                 status = AXIS2_FAILURE;
>             }
>         }
>     }
>     if (AXIS2_SUCCESS != status)
>     {
>         AXIS2_PHASE_FREE(message_processing, env);
>         message_processing = NULL;
>         return NULL;
>     }
>     message_processing = NULL;
> message_out = axis2_phase_create(env, AXIS2_PHASE_MESSAGE_OUT);
>     if (op_impl->base)
>     {
>         axis2_msg_t *msg = NULL;
>         msg = AXIS2_DESC_GET_CHILD(op_impl->base, env, AXIS2_MSG_OUT);
>         if (msg)
>         {
>             axis2_array_list_t *list = AXIS2_MSG_GET_FLOW(msg, env);
>             if (list)
>             {
>                 status = AXIS2_ARRAY_LIST_ADD(list, env,
>                         message_out);
>             }
>             else
>             {
>                 status = AXIS2_FAILURE;
>             }
>         }
>     }
>     if (AXIS2_SUCCESS != status)
>     {
>         AXIS2_PHASE_FREE(message_out, env);
>         message_out = NULL;
>         return NULL;
>     }
>     message_out = NULL;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to