diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-06 21:20:11 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-06 21:20:11 +0000 |
commit | eb5d461ed4688cafadc76bebf329a2fae454dc12 (patch) | |
tree | 5503cb153c9de46c07e3a0a521cc996926ed375b /apps/app_rpt.c | |
parent | 125558c76fd4870a9133e4974cce6410c89a3593 (diff) |
Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@67864 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_rpt.c')
-rw-r--r-- | apps/app_rpt.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/app_rpt.c b/apps/app_rpt.c index e59a7bbb5..cfded49c9 100644 --- a/apps/app_rpt.c +++ b/apps/app_rpt.c @@ -1353,7 +1353,7 @@ static int rpt_do_lstats(int fd, int argc, char *argv[]) l = l->next; continue; } - if ((s = (struct rpt_lstat *) ast_calloc(1, sizeof(struct rpt_lstat))) == NULL) { + if ((s = ast_calloc(1, sizeof(*s))) == NULL) { ast_log(LOG_ERROR, "Malloc failed in rpt_do_lstats\n"); rpt_mutex_unlock(&myrpt->lock); /* UNLOCK */ return RESULT_FAILURE; @@ -2186,7 +2186,7 @@ static void *rpt_tele_thread(void *this) l = l->next; continue; } - m = ast_malloc(sizeof(struct rpt_link)); + m = ast_malloc(sizeof(*m)); if (!m) { ast_log(LOG_WARNING, "Cannot alloc memory on %s\n", mychannel->name); remque((struct qelem *)mytele); @@ -2453,7 +2453,7 @@ static void rpt_telemetry(struct rpt *myrpt, int mode, void *data) struct rpt_link *mylink = (struct rpt_link *) data; int res; - tele = ast_calloc(1, sizeof(struct rpt_tele)); + tele = ast_calloc(1, sizeof(*tele)); if (!tele) { ast_log(LOG_WARNING, "Unable to allocate memory\n"); pthread_exit(NULL); @@ -2869,7 +2869,7 @@ static int function_ilink(struct rpt *myrpt, char *param, char *digits, int comm rpt_mutex_unlock(&myrpt->lock); ast_copy_string(myrpt->lastlinknode, digitbuf, MAXNODESTR); /* establish call in monitor mode */ - l = ast_calloc(1, sizeof(struct rpt_link)); + l = ast_calloc(1, sizeof(*l)); if (!l) { ast_log(LOG_WARNING, "Unable to malloc\n"); return DC_ERROR; @@ -2979,7 +2979,7 @@ static int function_ilink(struct rpt *myrpt, char *param, char *digits, int comm rpt_mutex_unlock(&myrpt->lock); ast_copy_string(myrpt->lastlinknode, digitbuf, MAXNODESTR); /* establish call in tranceive mode */ - l = ast_calloc(1, sizeof(struct rpt_link)); + l = ast_calloc(1, sizeof(*l)); if (!l) { ast_log(LOG_WARNING, "Unable to malloc\n"); return DC_ERROR; @@ -6982,7 +6982,7 @@ static int rpt_exec(struct ast_channel *chan, void *data) } else rpt_mutex_unlock(&myrpt->lock); /* establish call in tranceive mode */ - l = ast_calloc(1, sizeof(struct rpt_link)); + l = ast_calloc(1, sizeof(*l)); if (!l) { ast_log(LOG_WARNING, "Unable to malloc\n"); pthread_exit(NULL); |