From 0a6082c45a379b8bd51d917e0db20d1c357d2190 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 19 Jan 2011 22:36:30 +0000 Subject: Merged revisions 302785 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r302785 | russell | 2011-01-19 16:35:15 -0600 (Wed, 19 Jan 2011) | 15 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@302786 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/manager.c b/main/manager.c index 5edab2697..1f87d0376 100644 --- a/main/manager.c +++ b/main/manager.c @@ -4781,7 +4781,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; } -- cgit v1.2.3