[Asterisk-cvs] asterisk/channels/h323 ast_h323.cpp,1.54,1.55
jeremy at lists.digium.com
jeremy at lists.digium.com
Tue Jul 20 17:18:16 CDT 2004
Update of /usr/cvsroot/asterisk/channels/h323
In directory localhost.localdomain:/tmp/cvs-serv19702/h323
Modified Files:
ast_h323.cpp
Log Message:
first attempt to properly copy and then free call detail strings.
Index: ast_h323.cpp
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/h323/ast_h323.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- ast_h323.cpp 17 Jul 2004 19:38:30 -0000 1.54
+++ ast_h323.cpp 20 Jul 2004 21:04:16 -0000 1.55
@@ -375,11 +375,11 @@
remoteName = connection.GetRemotePartyName();
cd.call_reference = connection.GetCallReference();
- cd.call_token = (const char *)clearedCallToken;
- cd.call_source_aliases = (const char *)connection.GetRemotePartyName();
+ cd.call_token = strdup((const char *)clearedCallToken);
+ cd.call_source_aliases = strdup((const char *)connection.GetRemotePartyName());
connection.GetSignallingChannel()->GetRemoteAddress().GetIpAndPort(Ip, sourcePort);
- cd.sourceIp = (const char *)Ip.AsString();
+ cd.sourceIp = strdup((const char *)Ip.AsString());
/* Convert complex strings */
char *s;
@@ -539,7 +539,6 @@
PString sourceName;
PString sourceAliases;
PString destAliases;
- PString sourceIp;
PIPSocket::Address Ip;
WORD sourcePort;
char *s, *s1;
@@ -567,18 +566,15 @@
cd.call_reference = GetCallReference();
- cd.call_token = (const char *)GetCallToken();
- cd.call_source_aliases = (const char *)sourceAliases;
- cd.call_dest_alias = (const char *)destAliases;
- cd.call_source_e164 = (const char *)sourceE164;
- cd.call_dest_e164 = (const char *)destE164;
- cd.call_source_name = (const char *)sourceName;
+ cd.call_token = strdup((const char *)GetCallToken());
+ cd.call_source_aliases = strdup((const char *)sourceAliases);
+ cd.call_dest_alias = strdup((const char *)destAliases);
+ cd.call_source_e164 = strdup((const char *)sourceE164);
+ cd.call_dest_e164 = strdup((const char *)destE164);
+ cd.call_source_name = strdup((const char *)sourceName);
GetSignallingChannel()->GetRemoteAddress().GetIpAndPort(Ip, sourcePort);
- sourceIp = Ip.AsString();
- cd.sourceIp = (const char *)sourceIp;
-
-
+ cd.sourceIp = strdup((const char *)Ip.AsString());
/* Notify Asterisk of the request */
int res = on_incoming_call(cd);
@@ -622,11 +618,11 @@
*s1 = '\0';
cd.call_reference = GetCallReference();
- cd.call_token = (const char *)GetCallToken();
- cd.call_source_aliases = (const char *)sourceAliases;
- cd.call_dest_alias = (const char *)destAliases;
- cd.call_source_e164 = (const char *)sourceE164;
- cd.call_dest_e164 = (const char *)destE164;
+ cd.call_token = strdup((const char *)GetCallToken());
+ cd.call_source_aliases = strdup((const char *)sourceAliases);
+ cd.call_dest_alias = strdup((const char *)destAliases);
+ cd.call_source_e164 = strdup((const char *)sourceE164);
+ cd.call_dest_e164 = strdup((const char *)destE164);
int res = on_outgoing_call(cd);
More information about the svn-commits
mailing list