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

Robert Lazarski resolved AXIS2C-1591.
-------------------------------------
    Fix Version/s: 2.0.0
                       (was: 1.7.0)
       Resolution: Fixed

 When axiom_element_add_attribute was called with an attribute having the
    same name as an existing one, the old attribute was overwritten in the
    hash but never freed, causing a memory leak.
    
    The fix checks for an existing attribute with the same name before calling
    axutil_hash_set, and frees it if found.
    
    Added test_axis2c_1591_duplicate_attribute to verify the fix.


> axiom_element_add_attribute and duplicate names
> -----------------------------------------------
>
>                 Key: AXIS2C-1591
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1591
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: xml/om
>    Affects Versions: 1.7.0
>            Reporter: Sebastian Brandt
>            Priority: Minor
>              Labels: patch
>             Fix For: 2.0.0
>
>         Attachments: om_element.c.patch
>
>
> in axiom_element_add_attribute, the attribute is added to the hash of 
> attributes in om_element->attributes
> based on the name (axutil_qname_to_string).
> If an attribute with the same name is already in the hash, that entry is 
> overwritten and thus, will never be freed.
> This seems to be the case always if several xml nodes have the same namespace 
> - the attribute value itself is not used there, or are 
> we just talking namespace attributes here?
> I don't even begin to understand what the role of the attributes is, and what 
> happes, if the attributes are stored with different names or such.
> For the moment, I will try to create two hashes, one for the attributes that 
> are used, and one for the attributes that just have to be freed. Of course, a 
> list would be enough for the latter.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to