summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2011-01-19 22:36:30 +0000
committerRussell Bryant <russell@russellbryant.com>2011-01-19 22:36:30 +0000
commit0a6082c45a379b8bd51d917e0db20d1c357d2190 (patch)
tree27f2c77207454a56e9f4bb4f99e206e0487421c9
parentc8e57f82bfe63263aae27eb499675172fd84d4f6 (diff)
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
-rw-r--r--main/manager.c2
1 files changed, 1 insertions, 1 deletions
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;
}