Make sure to cleanup event if there was a failure that caused it not to be fired.

This commit is contained in:
William King 2013-06-12 17:01:56 -07:00
parent 5f1e9d93f2
commit 3815a5a170
1 changed files with 4 additions and 0 deletions

View File

@ -766,6 +766,10 @@ static switch_status_t handle_msg_sendevent(listener_t *listener, int arity, ei_
ei_x_encode_atom(rbuf, "ok");
}
}
/* If the event wasn't successfully fired, or failed for any other reason, then make sure not to leak it. */
if ( event ) {
switch_event_destroy(&event)
}
}
}
return SWITCH_STATUS_SUCCESS;