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

Freeswitch SVN anthm at freeswitch.org
Fri Dec 21 13:15:33 EST 2007


Author: anthm
Date: Fri Dec 21 13:15:33 2007
New Revision: 6951

Modified:
   freeswitch/trunk/src/switch_event.c

Log:
update

Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c	(original)
+++ freeswitch/trunk/src/switch_event.c	Fri Dec 21 13:15:33 2007
@@ -552,8 +552,10 @@
 {
 	switch_event_header_t *hp, *lp = NULL;
 	switch_status_t status = SWITCH_STATUS_FALSE;
-	
+	int x = 0;
 	for (hp = event->headers; hp; hp = hp->next) {
+		x++;
+		switch_assert(x < 1000);
 		if (!strcmp(header_name, hp->name)) {
 			if (lp) {
 				lp->next = hp->next;
@@ -562,6 +564,7 @@
 			}
 			FREE(hp->name);
 			FREE(hp->value);
+			memset(hp, 0, sizeof(*hp));
 			if (switch_queue_trypush(EVENT_HEADER_RECYCLE_QUEUE, hp) != SWITCH_STATUS_SUCCESS) {
 				FREE(hp);
 			}
@@ -606,11 +609,12 @@
 			event->headers = header;
 		} else {
 			for (hp = event->headers; hp && hp->next; hp = hp->next);
-
+			
 			if (hp) {
 				hp->next = header;
 			} else {
 				event->headers = header;
+				header->next = NULL;
 			}
 		}
 		return SWITCH_STATUS_SUCCESS;
@@ -652,11 +656,13 @@
 			hp = hp->next;
 			FREE(this->name);
 			FREE(this->value);
+			memset(this, 0, sizeof(*this));
 			if (switch_queue_trypush(EVENT_HEADER_RECYCLE_QUEUE, this) != SWITCH_STATUS_SUCCESS) {
 				FREE(this);
 			}
 		}
 		FREE(ep->body);
+		memset(ep, 0, sizeof(*ep));
 		if (switch_queue_trypush(EVENT_RECYCLE_QUEUE, ep) != SWITCH_STATUS_SUCCESS) {
 			FREE(ep);
 		}



More information about the Freeswitch-svn mailing list