]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix user reference leak in MeetMe.
authorSean Bright <sean@malleable.com>
Sat, 29 Jan 2011 16:26:57 +0000 (16:26 +0000)
committerSean Bright <sean@malleable.com>
Sat, 29 Jan 2011 16:26:57 +0000 (16:26 +0000)
We were unlinking the user from the conferences user container, but not
decrementing the reference count of the user as well, resulting in a leak.

(closes issue #18444)
Reported by: junky
Tested by: seanbright

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

apps/app_meetme.c

index 10f73b5e5e3f5e3b93b1cf69bd94592e8e909e7d..64a9686c16fbe62ca894ea5844ed31c568e34bd9 100644 (file)
@@ -3387,9 +3387,8 @@ bailoutandtrynormal:
                ast_dsp_free(dsp);
        }
        
-       if (!user->user_no) {
-               ao2_ref(user, -1);
-       } else { /* Only cleanup users who really joined! */
+       if (user->user_no) {
+               /* Only cleanup users who really joined! */
                now = ast_tvnow();
                hr = (now.tv_sec - user->jointime) / 3600;
                min = ((now.tv_sec - user->jointime) % 3600) / 60;
@@ -3443,6 +3442,7 @@ bailoutandtrynormal:
                        pbx_builtin_setvar_helper(chan, "MEETMEBOOKID", conf->bookid);
                }
        }
+       ao2_ref(user, -1);
        AST_LIST_UNLOCK(&confs);
 
        return ret;