From: Anthony Minessale Date: Mon, 16 Feb 2009 20:25:05 +0000 (+0000) Subject: remove leak X-Git-Tag: v1.0.3~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e858a1d8502a2ecf5f7fdd46e402f78abc72db48;p=thirdparty%2Ffreeswitch.git remove leak git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12068 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index a747fe46d5..f87572e845 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -270,7 +270,9 @@ SWITCH_DECLARE(const char *)Event::serialize(const char *format) } } else { if (switch_event_serialize(event, &serialized_string, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) { - serialized_string = switch_mprintf("'%s'", serialized_string); + char *new_serialized_string = switch_mprintf("'%s'", serialized_string); + free(serialized_string); + serialized_string = new_serialized_string; return serialized_string; } }