Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.6 Final
-
None
-
None
-
Observed on Linux and Solaris.
Description
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)
// 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..).