From: Andrew Thompson Date: Thu, 7 May 2009 22:13:05 +0000 (+0000) Subject: Use switch_xml_parse_str_dynamic so we don't leak (thanks Math) X-Git-Tag: v1.0.4~946 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffe00a236b562ec046cabe3fd67e179159b37bae;p=thirdparty%2Ffreeswitch.git Use switch_xml_parse_str_dynamic so we don't leak (thanks Math) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13256 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c index 921c33da77..9eb7386051 100644 --- a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c +++ b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c @@ -434,7 +434,7 @@ static switch_xml_t erlang_fetch(const char *sectionstr, const char *tag_name, c if (switch_strlen_zero(xmlstr)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n"); - } else if (!(xml = switch_xml_parse_str(xmlstr, strlen(xmlstr)))) { + } else if (!(xml = switch_xml_parse_str_dynamic(xmlstr, strlen(xmlstr)))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing XML Result!\n"); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "XML parsed OK!\n"); @@ -444,7 +444,6 @@ static switch_xml_t erlang_fetch(const char *sectionstr, const char *tag_name, c switch_core_hash_delete(ptr->listener->fetch_reply_hash, uuid_str); switch_safe_free(rep->buff); switch_safe_free(rep); - switch_safe_free(xmlstr); return xml; }