aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_meetme.c
diff options
context:
space:
mode:
authorbweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-13 03:34:31 +0000
committerbweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-13 03:34:31 +0000
commit589c3c0044b532cde995c7339a04714128a61d73 (patch)
tree4c1811d4204404d6e76227a772b535cb8ad0c154 /apps/app_meetme.c
parentbb26a9138e13c01ab7fba613854fabb788341d45 (diff)
More memory wrapper cleanup. #6224
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8045 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_meetme.c')
-rw-r--r--apps/app_meetme.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index c9bd87f41..da6d684e3 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -474,8 +474,7 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
if (!cnf && (make || dynamic)) {
/* Make a new one */
- cnf = calloc(1, sizeof(*cnf));
- if (cnf) {
+ if ((cnf = ast_calloc(1, sizeof(*cnf)))) {
ast_mutex_init(&cnf->playlock);
ast_mutex_init(&cnf->listenlock);
ast_copy_string(cnf->confno, confno, sizeof(cnf->confno));
@@ -535,8 +534,7 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
ast_verbose(VERBOSE_PREFIX_3 "Created MeetMe conference %d for conference '%s'\n", cnf->zapconf, cnf->confno);
cnf->next = confs;
confs = cnf;
- } else
- ast_log(LOG_WARNING, "Out of memory\n");
+ }
}
cnfout:
ast_mutex_unlock(&conflock);
@@ -851,7 +849,7 @@ static int conf_free(struct ast_conference *conf)
static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int confflags)
{
- struct ast_conf_user *user = calloc(1, sizeof(*user));
+ struct ast_conf_user *user = NULL;
struct ast_conf_user *usr = NULL;
int fd;
struct zt_confinfo ztc, ztc_empty;
@@ -887,9 +885,8 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
ZT_BUFFERINFO bi;
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
char *buf = __buf + AST_FRIENDLY_OFFSET;
-
- if (!user) {
- ast_log(LOG_ERROR, "Out of memory\n");
+
+ if (!(user = ast_calloc(1, sizeof(*user)))) {
return ret;
}