From: Michael Jerris Date: Fri, 16 May 2008 17:07:10 +0000 (+0000) Subject: don't leak after allocation failure. Found by Klockwork (www.klocwork.com) X-Git-Tag: v1.0-rc6~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16bf3f42a19b07fe5aea77a4098fc9ebb711170b;p=thirdparty%2Ffreeswitch.git don't leak after allocation failure. Found by Klockwork (www.klocwork.com) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8443 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/switch_event.c b/src/switch_event.c index 04f8f5d715..5bc27221d0 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -734,6 +734,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_serialize(switch_event_t *event, ch /* go ahead and give ourselves some space to work with, should save a few reallocs */ if (!(encode_buf = malloc(encode_len))) { + switch_safe_free(buf); return SWITCH_STATUS_MEMERR; }