]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Make sure to cleanup event if there was a failure that caused it not to be fired.
authorWilliam King <william.king@quentustech.com>
Thu, 13 Jun 2013 00:01:56 +0000 (17:01 -0700)
committerWilliam King <william.king@quentustech.com>
Thu, 13 Jun 2013 00:02:15 +0000 (17:02 -0700)
src/mod/event_handlers/mod_erlang_event/handle_msg.c

index 75d6c2043433cbb6eb872ef2a0f9ca455a8aa0c4..0dea52c0c37abf5bdfa09d4c3678848d678655de 100644 (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;