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

Memory Leak in SoapSerializer::addOutputParam()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • None
    • current (nightly)
    • Serialization
    • None
    • Windows XP, VS6 with Compuware BoundsChecker

    Description

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

      Attachments

        Activity

          People

            Unassigned Unassigned
            rmccullough Ryan McCullough
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: