aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-19 22:35:15 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-19 22:35:15 +0000
commitf4b3c74e76a897aef0a167e07998b2057a505b2d (patch)
tree04327b742a1fdc32c3ee6dbb0af694c2218e8a86 /main
parent28edaee8ae5be28a7713bf670e86eeb341f250ad (diff)
Resolve a memory leak with the manager interface is disabled.
The intent of this check as it stands in previous versions of Asterisk was to check if there are any active sessions. If there were no sessions, then the function would return immediately and not bother with queueing up the manager event to be processed. Since the conversion of storing sessions in an astobj2 container, this check will always pass. I changed it to go back to checking what was intended. The side effect of this was that if the AMI is disabled, the manager event queue is populated anyway, but the code that runs to clear out the queue never runs. A producer with no consumer is a bad thing. Reported internally by kmorgan. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@302785 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/manager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/manager.c b/main/manager.c
index b52cbd058..592565d79 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -4787,7 +4787,7 @@ int __ast_manager_event_multichan(int category, const char *event, int chancount
struct ast_str *buf;
int i;
- if (!sessions && AST_RWLIST_EMPTY(&manager_hooks)) {
+ if (!ao2_container_count(sessions) && AST_RWLIST_EMPTY(&manager_hooks)) {
return 0;
}