提交 29916c4d authored 作者: Jeremy Tregunna's avatar Jeremy Tregunna

Updated do_config() to strdup() three variables, and shutdown func to release that memory again.


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk/scripts/contrib@12839 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 35bd0cf7
...@@ -29,9 +29,9 @@ static switch_status_t do_config(switch_bool_t reload) ...@@ -29,9 +29,9 @@ static switch_status_t do_config(switch_bool_t reload)
if ((settings = switch_xml_child(cfg, "settings"))) { if ((settings = switch_xml_child(cfg, "settings"))) {
auth = switch_xml_child(settings, "auth"); auth = switch_xml_child(settings, "auth");
companyid = (char*)switch_xml_attr_soft(auth, "companyid"); companyid = strdup(switch_xml_attr_soft(auth, "companyid"));
userid = (char*)switch_xml_attr_soft(auth, "userid"); userid = strdup(switch_xml_attr_soft(auth, "userid"));
password = (char*)switch_xml_attr_soft(auth, "password"); password = strdup(switch_xml_attr_soft(auth, "password"));
} }
if (xml) if (xml)
...@@ -129,6 +129,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_fastsms_load) ...@@ -129,6 +129,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_fastsms_load)
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_fastsms_shutdown) SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_fastsms_shutdown)
{ {
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
free(companyid);
free(userid);
free(password);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论