Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2007-06-06 21:20:11 +00:00
parent 033a3df22a
commit 9d05ff8ed5
94 changed files with 2530 additions and 2701 deletions

View File

@@ -1936,7 +1936,7 @@ static struct ast_rtcp *ast_rtcp_new(void)
rtcp->them.sin_family = AF_INET;
if (rtcp->s < 0) {
free(rtcp);
ast_free(rtcp);
ast_log(LOG_WARNING, "Unable to allocate RTCP socket: %s\n", strerror(errno));
return NULL;
}
@@ -1977,7 +1977,7 @@ struct ast_rtp *ast_rtp_new_with_bindaddr(struct sched_context *sched, struct io
rtp->s = rtp_socket();
if (rtp->s < 0) {
free(rtp);
ast_free(rtp);
ast_log(LOG_ERROR, "Unable to allocate socket: %s\n", strerror(errno));
return NULL;
}
@@ -2017,9 +2017,9 @@ struct ast_rtp *ast_rtp_new_with_bindaddr(struct sched_context *sched, struct io
close(rtp->s);
if (rtp->rtcp) {
close(rtp->rtcp->s);
free(rtp->rtcp);
ast_free(rtp->rtcp);
}
free(rtp);
ast_free(rtp);
return NULL;
}
/* The port was used, increment it (by two). */
@@ -2035,9 +2035,9 @@ struct ast_rtp *ast_rtp_new_with_bindaddr(struct sched_context *sched, struct io
close(rtp->s);
if (rtp->rtcp) {
close(rtp->rtcp->s);
free(rtp->rtcp);
ast_free(rtp->rtcp);
}
free(rtp);
ast_free(rtp);
return NULL;
}
}
@@ -2204,13 +2204,13 @@ void ast_rtp_destroy(struct ast_rtp *rtp)
if (rtp->rtcp->schedid > 0)
ast_sched_del(rtp->sched, rtp->rtcp->schedid);
close(rtp->rtcp->s);
free(rtp->rtcp);
ast_free(rtp->rtcp);
rtp->rtcp=NULL;
}
#ifdef P2P_INTENSE
ast_mutex_destroy(&rtp->bridge_lock);
#endif
free(rtp);
ast_free(rtp);
}
static unsigned int calc_txstamp(struct ast_rtp *rtp, struct timeval *delivery)