提交 9b6063ae authored 作者: Stefan Knoblich's avatar Stefan Knoblich

sizeof does not work for dynamically allocated memory (Klocwork #532)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8507 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 40b96afb
...@@ -130,7 +130,7 @@ static switch_status_t my_on_hangup(switch_core_session_t *session) ...@@ -130,7 +130,7 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
xml_text_escaped = malloc(need_bytes); xml_text_escaped = malloc(need_bytes);
switch_assert(xml_text_escaped); switch_assert(xml_text_escaped);
memset(xml_text_escaped, 0, sizeof(xml_text_escaped)); memset(xml_text_escaped, 0, need_bytes);
if (globals.encode == 1) { if (globals.encode == 1) {
headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded"); headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
switch_url_encode(xml_text, xml_text_escaped, need_bytes - 1); switch_url_encode(xml_text, xml_text_escaped, need_bytes - 1);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论