axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manjula Peiris (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (AXIS2C-1313) Memory leak in axis2_desc_add_child
Date Wed, 24 Dec 2008 05:16:46 GMT

     [ https://issues.apache.org/jira/browse/AXIS2C-1313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Manjula Peiris reassigned AXIS2C-1313:
--------------------------------------

    Assignee: Manjula Peiris

> Memory leak in axis2_desc_add_child
> -----------------------------------
>
>                 Key: AXIS2C-1313
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1313
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/description
>         Environment: Win32/64
>            Reporter: Patrick van Beem
>            Assignee: Manjula Peiris
>             Fix For: 1.6.0
>
>         Attachments: axis2_desc_add_child.diff
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> axis2_desc_add_child() overwrites existing children with the same name. These become
orphaned and are leaking memory (they'll never get freed).
> Suggestion: Check for an existing child with the same key ad free it before replacing
it with the new child:
> AXIS2_EXTERN axis2_status_t AXIS2_CALL
> axis2_desc_add_child(
>     const axis2_desc_t * desc,
>     const axutil_env_t * env,
>     const axis2_char_t * key,
>     const void *child)
> {
>     if (desc->children)
>     {
>         /* Added from here */
>         axis2_msg_t* msg = (axis2_msg_t *) axutil_hash_get(desc->children, key, AXIS2_HASH_KEY_STRING);
>         if ( msg != NULL )
>         {
>             axis2_msg_free(msg, env);
>         }
>         /* Added to here */
>         axutil_hash_set(desc->children, key, AXIS2_HASH_KEY_STRING, child);
>         return AXIS2_SUCCESS;
>     }
>     return AXIS2_FAILURE;
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message