Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Win32/64
Description
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 )
/* Added to here */
axutil_hash_set(desc->children, key, AXIS2_HASH_KEY_STRING, child);
return AXIS2_SUCCESS;
}
return AXIS2_FAILURE;
}