Memory leak in Clients after arrays are serialized
--------------------------------------------------

                 Key: AXISCPP-989
                 URL: http://issues.apache.org/jira/browse/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,
m_nSize);
                }
                // 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: 
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