axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "nadir amra (JIRA)" <axis-c-...@ws.apache.org>
Subject [jira] Closed: (AXISCPP-1055) Memory Leak in SoapSerializer::addOutputParam()
Date Thu, 02 Oct 2008 14:03:44 GMT

     [ 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


Mime
View raw message