aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-28 21:22:09 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-28 21:22:09 +0000
commitb798a8d5291137188047e7a2d6a9f626c79487fa (patch)
treebf34cf1999c1981a0eefc7037f240f2179756095
parentf95cb3adf0faae072276febd07c91aa84d92c7f9 (diff)
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. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@304659 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_meetme.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 8191df6eb..963b729f2 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -1123,6 +1123,11 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
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 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
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 @@ bailoutandtrynormal:
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);