Uploaded image for project: 'Axis-C++'
  1. Axis-C++
  2. AXISCPP-628

SoapFault never deleted during exception processing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Client - Stub
    • 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)

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

      Attachments

        Activity

          People

            whitlock Mark Whitlock
            whitlock Mark Whitlock
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: