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