You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "nadir amra (JIRA)" <ax...@ws.apache.org> on 2008/10/02 16:03:44 UTC

[jira] Closed: (AXISCPP-1055) Memory Leak in SoapSerializer::addOutputParam()

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

nadir amra closed AXISCPP-1055.
-------------------------------

    Resolution: Invalid

 xsdValue is passed to Param object using:

 pParam->setValue(type, xsdValue);

The xsdValue is then owned by the Param object, which deletes the object when Param destructor is invoked.

> Memory Leak in SoapSerializer::addOutputParam()
> -----------------------------------------------
>
>                 Key: AXISCPP-1055
>                 URL: https://issues.apache.org/jira/browse/AXISCPP-1055
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: Serialization
>         Environment: Windows XP, VS6 with Compuware BoundsChecker 
>            Reporter: Ryan McCullough
>             Fix For: current (nightly)
>
>
> The function:
> int SoapSerializer::addOutputParam( const AxisChar * pchName, void * pValue, XSDTYPE type)
> contains a memory leak. xsdValue is not being deleted. Here is our proposed change:
> /*
>  * Basic output parameter going to be serialized as an Element later
>  */
> int SoapSerializer::
> addOutputParam( const AxisChar * pchName, void * pValue, XSDTYPE type)
> {
>     IAnySimpleType* xsdValue = AxisUtils::createSimpleTypeObject(pValue, type);
>     
>     Param * pParam = new Param();
>     if( !pParam)
>         return AXIS_FAIL;
>     pParam->m_Type = type;
>     pParam->m_sName = pchName;
>     pParam->setValue(type, xsdValue);
>     
>     if( m_pSoapEnvelope &&
>         (m_pSoapEnvelope->m_pSoapBody) &&
>         (m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod)) 
>         m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod->addOutputParam( pParam);
>     else
>     {
>         delete xsdValue;
>         delete pParam;
>         return AXIS_FAIL;
>     }
>     delete xsdValue;
>     return AXIS_SUCCESS;  // Can it only be successful?
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org