]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
bug found by pyite in new filter feature.
authorMichael Jerris <mike@jerris.com>
Thu, 30 Oct 2008 02:27:22 +0000 (02:27 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 30 Oct 2008 02:27:22 +0000 (02:27 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10200 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/event_handlers/mod_event_socket/mod_event_socket.c

index 8cb707637acb68309f758bb8774e6266665c5d73..cc6b6a9cf0a31767f2df25f36c5b4ba1185e7d0e 100644 (file)
@@ -177,8 +177,8 @@ static void flush_listener(listener_t *listener, switch_bool_t flush_log, switch
 
        if (listener->event_queue) {
                while (switch_queue_trypop(listener->event_queue, &pop) == SWITCH_STATUS_SUCCESS) {
-                       if (!pop) continue;
                        switch_event_t *pevent = (switch_event_t *) pop;
+                       if (!pop) continue;
                        switch_event_destroy(&pevent);
                }
        }
@@ -214,7 +214,7 @@ static void event_handler(switch_event_t *event)
 
        switch_mutex_lock(listen_list.mutex);
        while(lp) {
-               uint8_t send = 0;
+               int send = 0;
                
                l = lp;
                lp = lp->next;
@@ -245,7 +245,7 @@ static void event_handler(switch_event_t *event)
 
                        send = 0;
                        switch_mutex_lock(l->filter_mutex);
-                       for (hp = l->filters->headers; hp; hp = hp->next) {
+                       for (hp = l->filters->headers; hp && !send; hp = hp->next) {
                                if ((hval = switch_event_get_header(event, hp->name))) {
                                        if (*hp->value == '/') {
                                                switch_regex_t *re = NULL;