mighty putty for a big leak

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12291 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2009-02-26 00:14:03 +00:00
1 parent d162e05b89
commit 8f7bb61e1f
4 files changed
+7 -39

No files matched your search

+2 -22
View File
@@ -810,7 +810,7 @@ SWITCH_DECLARE(void) switch_event_destroy(switch_event_t **event)
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 @@ SWITCH_DECLARE(switch_status_t) switch_event_dup(switch_event_t **event, switch_
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) {