axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Whitlock (JIRA)" <axis-c-...@ws.apache.org>
Subject [jira] Closed: (AXISCPP-628) SoapFault never deleted during exception processing
Date Mon, 25 Apr 2005 13:04:25 GMT
     [ http://issues.apache.org/jira/browse/AXISCPP-628?page=all ]
     
Mark Whitlock closed AXISCPP-628:
---------------------------------


> SoapFault never deleted during exception processing
> ---------------------------------------------------
>
>          Key: AXISCPP-628
>          URL: http://issues.apache.org/jira/browse/AXISCPP-628
>      Project: Axis-C++
>         Type: Bug
>   Components: Client - Stub
>     Reporter: Mark Whitlock
>     Assignee: Mark Whitlock

>
> The following piece of code is generated by the WSDL2Ws tool:
>  ISoapFault* pSoapFault = (ISoapFault*)
>                         m_pCall->checkFault("Fault","http://localhost:9080/xxx/services/xxx"
);
>                         if(pSoapFault)
>                         {
>                                 const char *detail = pSoapFault->getSimpleFaultDetail();
>                                 bool deleteDetail=false;
>                                 if (NULL==detail || 0==strlen(detail))
>                                 {
>                                         detail=m_pCall->getFaultAsXMLString();
>                                         if (NULL==detail)
>                                         {
>                                                 detail="";
>                                         }
>                                         else
>                                         {
>                                                 deleteDetail=true;
>                                       }
>                                 }
>                                 OtherFaultException ofe(pSoapFault->getFaultcode(),
>                                         pSoapFault->getFaultstring(), pSoapFault->getFaultactor(),
>                                         detail, iExceptionCode);
>                                 if (deleteDetail && NULL!=detail)
>                                 {
>                                         delete [] const_cast<char*>(detail);
>                                 }
>                                 m_pCall->unInitialize();
>                                 throw ofe;
>                         }
> This causes a leak because pSoapFault is never deleted. I tried to fix this by adding
a delete as follows:
>                                 if (deleteDetail && NULL!=detail)
>                                 {
>                                         delete [] const_cast<char*>(detail);
>                                 }
> 		delete pSoapFault;
>                                 m_pCall->unInitialize();
>                                 throw ofe;
>  
> But this is causing a core dump on Linux and AIX. There seem to be several places where
the SoapFault should be deleted.

-- 
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


Mime
View raw message