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

possible memory leak in the int SoapSerializer::setOutputStream( SOAPTransport * pStream) - SoapSerializer.cpp file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 1.6 Alpha
    • SOAP
    • None

    Description

      Hello,

      In the following code from the SoapSerializer.cpp file string * asContentType leaks. It should not be heap allocated, I suppose:
      string asContentType = string( "multipart/related; type=\"text/xml\"; start=\"<");
      instead of
      string * asContentType = new string( "multipart/related; type=\"text/xml\"; start=\"<");
      This would also simplify the syntax .
      Taken from v 1.5 sources.

      PS
      Seems to be caused by too straightforward porting of Java code.

      if( checkAttachmentAvailability())
      {
      string asStartID;
      string asSOAPMimeHeaders;

      asSOAPMimeHeaders = pStream->getIncomingSOAPMimeHeaders();

      int start = asSOAPMimeHeaders.find( "Content-Type");
      int startPosIdValue = asSOAPMimeHeaders.find( "<", start + strlen( "Content-Id:")) + 1;
      int endPosIdValue = asSOAPMimeHeaders.find( ">", start + strlen( "Content-Type"));
      int length = endPosIdValue - startPosIdValue ;

      asStartID = asSOAPMimeHeaders.substr (startPosIdValue,length);

      string * asContentType = new string( "multipart/related; type=\"text/xml\"; start=\"<");

      *asContentType = *asContentType + asStartID + ">\"";
      *asContentType = *asContentType + "; boundary=\"------=MIME BOUNDARY\"";

      pStream->setTransportProperty( CONTENT_TYPE, (*asContentType).c_str());

      serialize( "\n------=MIME BOUNDARY\n", NULL);
      serialize( pStream->getIncomingSOAPMimeHeaders(), "\n\n", NULL);
      }

      Attachments

        Activity

          People

            samisa Don Samisa Abeysinghe
            den Denis Linine
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: