manager: fix memory leak in manager_add_filter function
authorJonathan Rose <jrose@digium.com>
Fri, 14 Mar 2014 21:36:55 +0000 (21:36 +0000)
committerJonathan Rose <jrose@digium.com>
Fri, 14 Mar 2014 21:36:55 +0000 (21:36 +0000)
(closes issue ASTERISK-23420)
Reported by: Etienne Lessard
Patches:
    manager_eventfilter_leak uploaded by Etienne Lessard (license 6394)
........

Merged revisions 410609 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 410623 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410624 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/manager.c

index fe4e7c3..3c98185 100644 (file)
@@ -5150,6 +5150,8 @@ static enum add_filter_result manager_add_filter(const char *filter_pattern, str
                ao2_t_link(whitefilters, new_filter, "link new filter into white user container");
        }
 
+       ao2_ref(new_filter, -1);
+
        return FILTER_SUCCESS;
 }