remove double event crate, removing a memory leak in valet parking

This commit is contained in:
Anthony Minessale 2014-01-23 02:52:42 +05:00
parent 5a820fdc78
commit 4b07ee5183

View File

@ -805,7 +805,6 @@ static void pres_event_handler(switch_event_t *event)
int count = valet_lot_count(lot); int count = valet_lot_count(lot);
if (count) { if (count) {
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", VALET_PROTO); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", VALET_PROTO);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", lot_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", lot_name);
@ -823,7 +822,6 @@ static void pres_event_handler(switch_event_t *event)
switch_event_fire(&event); switch_event_fire(&event);
} }
found++; found++;
}
} else { } else {
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", VALET_PROTO); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", VALET_PROTO);