[asterisk-commits] seanbright: branch 1.6.2 r304659 - /branches/1.6.2/apps/app_meetme.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jan 28 15:22:13 CST 2011
Author: seanbright
Date: Fri Jan 28 15:22:09 2011
New Revision: 304659
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=304659
Log:
Don't leak references if we can't create a pseudo channel for mixing in MeetMe.
If there was a problem allocating a pseudo channel when building our meetme, we
weren't destroying our user container or destroying the mutexes that we created.
Modified:
branches/1.6.2/apps/app_meetme.c
Modified: branches/1.6.2/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/apps/app_meetme.c?view=diff&rev=304659&r1=304658&r2=304659
==============================================================================
--- branches/1.6.2/apps/app_meetme.c (original)
+++ branches/1.6.2/apps/app_meetme.c Fri Jan 28 15:22:09 2011
@@ -1123,6 +1123,11 @@
ast_log(LOG_WARNING, "Unable to open DAHDI pseudo device\n");
if (cnf->fd >= 0)
close(cnf->fd);
+ ao2_ref(cnf->usercontainer, -1);
+ ast_mutex_destroy(&cnf->playlock);
+ ast_mutex_destroy(&cnf->listenlock);
+ ast_mutex_destroy(&cnf->recordthreadlock);
+ ast_mutex_destroy(&cnf->announcethreadlock);
ast_free(cnf);
cnf = NULL;
goto cnfout;
@@ -1144,7 +1149,11 @@
ast_hangup(cnf->chan);
else
close(cnf->fd);
-
+ ao2_ref(cnf->usercontainer, -1);
+ ast_mutex_destroy(&cnf->playlock);
+ ast_mutex_destroy(&cnf->listenlock);
+ ast_mutex_destroy(&cnf->recordthreadlock);
+ ast_mutex_destroy(&cnf->announcethreadlock);
ast_free(cnf);
cnf = NULL;
goto cnfout;
@@ -3429,6 +3438,8 @@
snprintf(meetmesecs, sizeof(meetmesecs), "%d", (int) (time(NULL) - user->jointime));
pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs);
+ /* ao2_ref(user, -1); */
+
/* Return the RealTime bookid for CDR linking */
if (rt_schedule) {
pbx_builtin_setvar_helper(chan, "MEETMEBOOKID", conf->bookid);
More information about the asterisk-commits
mailing list