axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Kelly (JIRA)" <>
Subject [jira] Created: (AXISCPP-989) Memory leak in Clients after arrays are serialized
Date Wed, 09 Aug 2006 07:29:13 GMT
Memory leak in Clients after arrays are serialized

                 Key: AXISCPP-989
             Project: Axis-C++
          Issue Type: Bug
          Components: Serialization
    Affects Versions:  1.6 Final
         Environment: Observed on Linux and Solaris. 
            Reporter: Niall Kelly

When an array of elements is serialized on the client side prior to invoking an operation,
memory is leaked.

In the SoapSerializer::addOutputCmplxArrayParam method, the pArray argument is cloned (pLocalArray),
after which the clone is used as an argument of makeArrayBean. The internal array associated
with the clone is then "de-coupled" before pLocalArray is destroyed. At this point the new
ArrayBean object assumes ownership for the array memory.

At some point after serialization the ArrayBean object is destroyed. However it's constructor
does not delete the memory associated with the array and the elements it contains. In the
extract below from ~ArrayBean, the check for AxisEngine::m_bServer prevents the array from
being deleted (for applications on the client side).

    // Extract from ~ArrayBean
    if (USER_TYPE == m_type)
        if (m_value.cta)
            if (m_value.cta->pObject)
              if (AxisEngine::m_bServer)
                    m_value.cta->pDelFunct(m_value.cta->pObject, true,
                // make sure that the ComplexObjectHandler's destructor does

                // not try to delete the objects again 
                m_value.cta->pObject = NULL;
            delete m_value.cta;
            m_value.cta = NULL;

Perhaps this memory leak can be fixed by simple removing that check for AxisEngine::m_bServer
and always invoking m_value.cta->pDelFunct (i.e. the appropriate genereted delete method..).

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message