[Freeswitch-svn] [commit] r12291 - in freeswitch/trunk: libs/esl/src src src/mod/asr_tts/mod_flite src/mod/endpoints/mod_opal

FreeSWITCH SVN anthm at freeswitch.org
Wed Feb 25 16:14:04 PST 2009


Author: anthm
Date: Wed Feb 25 18:14:03 2009
New Revision: 12291

Log:
mighty putty for a big leak

Modified:
   freeswitch/trunk/libs/esl/src/esl_event.c
   freeswitch/trunk/src/mod/asr_tts/mod_flite/Makefile
   freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp
   freeswitch/trunk/src/switch_event.c

Modified: freeswitch/trunk/libs/esl/src/esl_event.c
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl_event.c	(original)
+++ freeswitch/trunk/libs/esl/src/esl_event.c	Wed Feb 25 18:14:03 2009
@@ -389,7 +389,7 @@
 
 ESL_DECLARE(esl_status_t) esl_event_dup(esl_event_t **event, esl_event_t *todup)
 {
-	esl_event_header_t *header, *hp, *hp2, *last = NULL;
+	esl_event_header_t *hp, *hp2;
 
 	if (esl_event_create_subclass(event, todup->event_id, todup->subclass_name) != ESL_SUCCESS) {
 		return ESL_FAIL;
@@ -404,21 +404,7 @@
 	hp2 = (*event)->headers;
 
 	for (hp = todup->headers; hp; hp = hp->next) {
-		header = ALLOC(sizeof(*header));
-		esl_assert(header);
-
-		memset(header, 0, sizeof(*header));
-
-		header->name = DUP(hp->name);
-		header->value = DUP(hp->value);
-
-		if (last) {
-			last->next = header;
-		} else {
-			(*event)->headers = header;
-		}
-
-		(*event)->last_header = last = header;
+		esl_event_add_header_string(*event, ESL_STACK_BOTTOM, hp->name, hp->value);
 	}
 
 	if (todup->body) {

Modified: freeswitch/trunk/src/mod/asr_tts/mod_flite/Makefile
==============================================================================
--- freeswitch/trunk/src/mod/asr_tts/mod_flite/Makefile	(original)
+++ freeswitch/trunk/src/mod/asr_tts/mod_flite/Makefile	Wed Feb 25 18:14:03 2009
@@ -5,7 +5,7 @@
 	$(FLITE_LIBDIR)/libflite_cmu_us_kal.a \
 	$(FLITE_LIBDIR)/libflite_cmu_us_rms.a \
 	$(FLITE_LIBDIR)/libflite_cmu_us_slt.a \
-	$(FLITE_LIBDIR)/libflite_cmulex.a $(FLITE_LIBDIR)/libflite_usenglish.a $(FLITE_LIBDIR)/libflite.a -lm
+	$(FLITE_LIBDIR)/libflite_cmulex.a $(FLITE_LIBDIR)/libflite_usenglish.a $(FLITE_LIBDIR)/libflite.a -lm -lasound
 
 LOCAL_CFLAGS=-I$(switch_srcdir)/libs/$(FLITE)/include
 LOCAL_LIBADD=$(FLITE_A)

Modified: freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp	Wed Feb 25 18:14:03 2009
@@ -446,6 +446,8 @@
         }
     }
 
+    switch_event_destroy(&params);
+
     if (xml)
         switch_xml_free(xml);
 

Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c	(original)
+++ freeswitch/trunk/src/switch_event.c	Wed Feb 25 18:14:03 2009
@@ -810,7 +810,7 @@
 
 SWITCH_DECLARE(switch_status_t) switch_event_dup(switch_event_t **event, switch_event_t *todup)
 {
-	switch_event_header_t *header, *hp, *hp2, *last = NULL;
+	switch_event_header_t *hp, *hp2;
 
 	if (switch_event_create_subclass(event, todup->event_id, todup->subclass_name) != SWITCH_STATUS_SUCCESS) {
 		return SWITCH_STATUS_GENERR;
@@ -825,27 +825,7 @@
 	hp2 = (*event)->headers;
 
 	for (hp = todup->headers; hp; hp = hp->next) {
-		void *pop;
-
-		if (switch_queue_trypop(EVENT_HEADER_RECYCLE_QUEUE, &pop) == SWITCH_STATUS_SUCCESS) {
-			header = (switch_event_header_t *) pop;
-		} else {
-			header = ALLOC(sizeof(*header));
-			switch_assert(header);
-		}
-
-		memset(header, 0, sizeof(*header));
-
-		header->name = DUP(hp->name);
-		header->value = DUP(hp->value);
-
-		if (last) {
-			last->next = header;
-		} else {
-			(*event)->headers = header;
-		}
-
-		(*event)->last_header = last = header;
+		switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, hp->name, hp->value);
 	}
 
 	if (todup->body) {



More information about the Freeswitch-svn mailing list