Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
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)
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.