You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Henrik Nordberg (JIRA)" <ax...@ws.apache.org> on 2006/01/26 06:51:09 UTC
[jira] Commented: (AXISCPP-923) Memory leak in
HTTPChannel::ReportError
[ http://issues.apache.org/jira/browse/AXISCPP-923?page=comments#action_12364059 ]
Henrik Nordberg commented on AXISCPP-923:
-----------------------------------------
I vote for changing the code to use string instead of string*. What was the thinking behind using a pointer in this case?
> Memory leak in HTTPChannel::ReportError
> ----------------------------------------
>
> Key: AXISCPP-923
> URL: http://issues.apache.org/jira/browse/AXISCPP-923
> Project: Axis-C++
> Type: Bug
> Components: Transport (axis3)
> Versions: current (nightly)
> Environment: All platforms, issue found in drop 24-Jan-2006 21:23
> Reporter: Emanuel Norrbin
>
> File: transport\axis3\HTTPChannel\HTTPChannel.cpp
> Method: void HTTPChannel::ReportError( char * szText1, char * szText2)
> Line: 750 - 755
> void HTTPChannel::ReportError( char * szText1, char * szText2)
> {
> long dwMsg = GETLASTERROR
> string * sMsg = PLATFORM_GET_ERROR_MESSAGE( dwMsg);
> char szMsg[600];
> sprintf( szMsg, "%s %d %s: '%s'\n", szText1, (int) dwMsg, szText2, sMsg->c_str());
> m_LastError = szMsg;
> }
> In this method the string* sMsg is never deleted. I don't see why a string* is used
> when a string would have worked just as well, but if a pointer is used it has to be deleted.
> /Emanuel
--
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