[Freeswitch-svn] [commit] r8443 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Fri May 16 13:07:10 EDT 2008


Author: mikej
Date: Fri May 16 13:07:10 2008
New Revision: 8443

Modified:
   freeswitch/trunk/src/switch_event.c

Log:
don't leak after allocation failure. Found by Klockwork (www.klocwork.com)

Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c	(original)
+++ freeswitch/trunk/src/switch_event.c	Fri May 16 13:07:10 2008
@@ -734,6 +734,7 @@
 
 	/* 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;
 	}
 



More information about the Freeswitch-svn mailing list