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

         Key: AXISCPP-811
         URL: http://issues.apache.org/jira/browse/AXISCPP-811
     Project: Axis-C++
        Type: Bug
  Components: SOAP  
    Reporter: Denis Linine
    Priority: Trivial


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);
}


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

Reply via email to