From: Sean Bright Date: Sat, 29 Jan 2011 18:08:14 +0000 (+0000) Subject: If we fail to allocate our announcement objects, make sure we don't leak objects. X-Git-Tag: 1.6.2.18-rc1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da82320fdd1a42b07d2c0e5331650352b4d8ec49;p=thirdparty%2Fasterisk.git If we fail to allocate our announcement objects, make sure we don't leak objects. The majority of this patch was committed already in r304726 and r304729. (issue #18225) Reported by: kenji (issue #18444) Reported by: junky (closes issue #18343) Reported by: kobaz Patches: meetme-refs.diff uploaded by kobaz (license 834) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@304776 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_meetme.c b/apps/app_meetme.c index ab34b49a3b..647b3af6b9 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -2475,7 +2475,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c if (!(confflags & CONFFLAG_QUIET) && ((confflags & CONFFLAG_INTROUSER) || (confflags & CONFFLAG_INTROUSERNOREVIEW)) && conf->users > 1) { struct announce_listitem *item; if (!(item = ao2_alloc(sizeof(*item), NULL))) - return -1; + goto outrun; ast_copy_string(item->namerecloc, user->namerecloc, sizeof(item->namerecloc)); ast_copy_string(item->language, chan->language, sizeof(item->language)); item->confchan = conf->chan; @@ -3375,7 +3375,7 @@ bailoutandtrynormal: if (!(confflags & CONFFLAG_QUIET) && ((confflags & CONFFLAG_INTROUSER) || (confflags & CONFFLAG_INTROUSERNOREVIEW)) && conf->users > 1) { struct announce_listitem *item; if (!(item = ao2_alloc(sizeof(*item), NULL))) - return -1; + goto outrun; ast_copy_string(item->namerecloc, user->namerecloc, sizeof(item->namerecloc)); ast_copy_string(item->language, chan->language, sizeof(item->language)); item->confchan = conf->chan;