From: Stefan Knoblich Date: Wed, 21 May 2008 20:05:46 +0000 (+0000) Subject: sizeof does not work for dynamically allocated memory (Klocwork #532) X-Git-Tag: v1.0.0~170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b6063ae77a71620affd6656bef08bfd2209e84d;p=thirdparty%2Ffreeswitch.git 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 --- diff --git a/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c b/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c index 39a48dab4f..d5c5508152 100644 --- a/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c +++ b/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c @@ -130,7 +130,7 @@ static switch_status_t my_on_hangup(switch_core_session_t *session) xml_text_escaped = malloc(need_bytes); 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) { headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded"); switch_url_encode(xml_text, xml_text_escaped, need_bytes - 1);