[Freeswitch-svn] [commit] r12839 - freeswitch/trunk/scripts/contrib/jtregunna/mod_fastsms
FreeSWITCH SVN
jtregunna at freeswitch.org
Mon Mar 30 08:07:38 PDT 2009
Author: jtregunna
Date: Mon Mar 30 10:07:38 2009
New Revision: 12839
Log:
Updated do_config() to strdup() three variables, and shutdown func to release that memory again.
Modified:
freeswitch/trunk/scripts/contrib/jtregunna/mod_fastsms/mod_fastsms.c
Modified: freeswitch/trunk/scripts/contrib/jtregunna/mod_fastsms/mod_fastsms.c
==============================================================================
--- freeswitch/trunk/scripts/contrib/jtregunna/mod_fastsms/mod_fastsms.c (original)
+++ freeswitch/trunk/scripts/contrib/jtregunna/mod_fastsms/mod_fastsms.c Mon Mar 30 10:07:38 2009
@@ -29,9 +29,9 @@
if ((settings = switch_xml_child(cfg, "settings"))) {
auth = switch_xml_child(settings, "auth");
- companyid = (char*)switch_xml_attr_soft(auth, "companyid");
- userid = (char*)switch_xml_attr_soft(auth, "userid");
- password = (char*)switch_xml_attr_soft(auth, "password");
+ companyid = strdup(switch_xml_attr_soft(auth, "companyid"));
+ userid = strdup(switch_xml_attr_soft(auth, "userid"));
+ password = strdup(switch_xml_attr_soft(auth, "password"));
}
if (xml)
@@ -129,6 +129,9 @@
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_fastsms_shutdown)
{
curl_easy_cleanup(curl);
+ free(companyid);
+ free(userid);
+ free(password);
return SWITCH_STATUS_SUCCESS;
}
More information about the Freeswitch-svn
mailing list