You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by wh...@apache.org on 2004/11/03 16:17:40 UTC
cvs commit: ws-axis/c/src/engine/client Stub.cpp
whitlock 2004/11/03 07:17:40
Modified: c/include/axis/client Call.hpp
c/src/engine SOAPTransportFactory.cpp XMLParserFactory.cpp
c/src/engine/client Stub.cpp
Log:
Replace mallocs/frees/strdups with news/deletes
Revision Changes Path
1.5 +0 -1 ws-axis/c/include/axis/client/Call.hpp
Index: Call.hpp
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/client/Call.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Call.hpp 29 Oct 2004 09:53:35 -0000 1.4
+++ Call.hpp 3 Nov 2004 15:17:40 -0000 1.5
@@ -52,7 +52,6 @@
#include "../server/Packet.hpp"
#include "../server/TypeMapping.hpp"
#include "../server/AxisUserAPI.hpp"
-#include "../server/SoapEnvVersions.hpp"
#include "../server/WSDDDefines.hpp"
#include "../server/IHeaderBlock.hpp"
#include "../server/ISoapHeader.hpp"
1.19 +6 -2 ws-axis/c/src/engine/SOAPTransportFactory.cpp
Index: SOAPTransportFactory.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/SOAPTransportFactory.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- SOAPTransportFactory.cpp 1 Nov 2004 15:04:49 -0000 1.18
+++ SOAPTransportFactory.cpp 3 Nov 2004 15:17:40 -0000 1.19
@@ -65,7 +65,9 @@
{
unloadLib();
AXISTRACE1("SERVER_ENGINE_LOADING_TRANSPORT_FAILED", CRITICAL);
- throw AxisEngineException(SERVER_ENGINE_LOADING_TRANSPORT_FAILED, strdup(m_pcLibraryPath));
+ char *s = new char[strlen(m_pcLibraryPath)+1];
+ strcpy(s,m_pcLibraryPath);
+ throw AxisEngineException(SERVER_ENGINE_LOADING_TRANSPORT_FAILED, s);
}
else
{
@@ -86,7 +88,9 @@
else
{
AXISTRACE1("SERVER_ENGINE_LOADING_TRANSPORT_FAILED", CRITICAL);
- throw AxisEngineException(SERVER_ENGINE_LOADING_TRANSPORT_FAILED, strdup(m_pcLibraryPath));
+ char *s = new char[strlen(m_pcLibraryPath)+1];
+ strcpy(s,m_pcLibraryPath);
+ throw AxisEngineException(SERVER_ENGINE_LOADING_TRANSPORT_FAILED, s);
}
return AXIS_SUCCESS;
}
1.18 +6 -2 ws-axis/c/src/engine/XMLParserFactory.cpp
Index: XMLParserFactory.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/XMLParserFactory.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- XMLParserFactory.cpp 1 Nov 2004 15:04:49 -0000 1.17
+++ XMLParserFactory.cpp 3 Nov 2004 15:17:40 -0000 1.18
@@ -62,13 +62,17 @@
{
unloadLib();
AXISTRACE1("SERVER_ENGINE_LOADING_PARSER_FAILED" , CRITICAL);
- throw AxisEngineException(SERVER_ENGINE_LOADING_PARSER_FAILED, strdup(m_pcLibraryPath));
+ char *s = new char[strlen(m_pcLibraryPath)+1];
+ strcpy(s,m_pcLibraryPath);
+ throw AxisEngineException(SERVER_ENGINE_LOADING_PARSER_FAILED, s);
}
}
else
{
AXISTRACE1("SERVER_ENGINE_LOADING_PARSER_FAILED" , CRITICAL);
- throw AxisEngineException(SERVER_ENGINE_LOADING_PARSER_FAILED, strdup(m_pcLibraryPath));
+ char *s = new char[strlen(m_pcLibraryPath)+1];
+ strcpy(s,m_pcLibraryPath);
+ throw AxisEngineException(SERVER_ENGINE_LOADING_PARSER_FAILED, s);
}
return AXIS_SUCCESS;
}
1.22 +14 -8 ws-axis/c/src/engine/client/Stub.cpp
Index: Stub.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/client/Stub.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Stub.cpp 2 Nov 2004 13:53:31 -0000 1.21
+++ Stub.cpp 3 Nov 2004 15:17:40 -0000 1.22
@@ -62,8 +62,8 @@
delete m_pCall;
for (unsigned int i = 0; i < m_vKeys.size(); i++)
{
- free(m_vKeys[i]);
- free(m_vValues[i]);
+ delete [] m_vKeys[i];
+ delete [] m_vValues[i];
}
for (unsigned int j = 0; j < m_vSOAPHeaderBlocks.size(); j++)
@@ -81,8 +81,12 @@
{
if (pcKey && pcValue)
{
- m_vKeys.push_back(strdup(pcKey));
- m_vValues.push_back(strdup(pcValue));
+ char *s = new char[strlen(pcKey)+1];
+ strcpy(s,pcKey);
+ m_vKeys.push_back(s);
+ s = new char[strlen(pcValue)+1];
+ strcpy(s,pcValue);
+ m_vValues.push_back(s);
}
}
@@ -146,10 +150,12 @@
{
if (m_viCurrentKey != m_vKeys.end())
{
- free(*m_viCurrentKey);
- free(*m_viCurrentValue);
+ delete [] *m_viCurrentKey;
+ delete [] *m_viCurrentValue;
m_vKeys.erase(m_viCurrentKey);
m_vValues.erase(m_viCurrentValue);
+ m_viCurrentKey = m_vKeys.begin();
+ m_viCurrentValue = m_vValues.begin();
}
}
@@ -165,8 +171,8 @@
{
if(uiCount == uiOccurance)
{
- free(*currentKey);
- free(*currentValue);
+ delete [] *currentKey;
+ delete [] *currentValue;
m_vKeys.erase(currentKey);
m_vValues.erase(currentValue);
}