summaryrefslogtreecommitdiff
path: root/apps/app_meetme.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2012-04-06 20:32:52 +0000
committerMatthew Jordan <mjordan@digium.com>2012-04-06 20:32:52 +0000
commitaa21d4fc6b1cef694d29939d97967183f849d245 (patch)
tree2e2def77ba42db1380351756845d48835d20c176 /apps/app_meetme.c
parent4665986fb1f56170eea5125038731639ee60be88 (diff)
Fix memory leak when using MeetMeAdmin 'e' option with user specified
A memory leak/reference counting leak occurs if the MeetMeAdmin 'e' command (eject last user that joined) is used in conjunction with a specified user. Regardless of the command being executed, if a user is specified for the command, MeetMeAdmin will look up that user. Because the 'e' option kicks the last user that joined, as opposed to the one specified, the reference to the user specified by the command would be leaked when the user variable was assigned to the last user that joined. ........ Merged revisions 361558 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 361560 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_meetme.c')
-rw-r--r--apps/app_meetme.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 742d487ff..f5d480de1 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -4701,6 +4701,12 @@ static int admin_exec(struct ast_channel *chan, const char *data) {
case 101: /* e: Eject last user*/
{
int max_no = 0;
+
+ /* If they passed in a user, disregard it */
+ if (user) {
+ ao2_ref(user, -1);
+ }
+
ao2_callback(cnf->usercontainer, OBJ_NODATA, user_max_cmp, &max_no);
user = ao2_find(cnf->usercontainer, &max_no, 0);
if (!ast_test_flag64(&user->userflags, CONFFLAG_ADMIN))