summaryrefslogtreecommitdiff
path: root/main/io.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2007-06-06 21:20:11 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2007-06-06 21:20:11 +0000
commit9d05ff8ed5f2c898370896ff7a8bb67885596ba1 (patch)
tree5503cb153c9de46c07e3a0a521cc996926ed375b /main/io.c
parent033a3df22aa68f04327066e0567b76f73c437651 (diff)
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
Diffstat (limited to 'main/io.c')
-rw-r--r--main/io.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/main/io.c b/main/io.c
index 209f27926..a2ab16635 100644
--- a/main/io.c
+++ b/main/io.c
@@ -87,12 +87,12 @@ struct io_context *io_context_create(void)
tmp->current_ioc = -1;
if (!(tmp->fds = ast_calloc(1, (GROW_SHRINK_SIZE / 2) * sizeof(*tmp->fds)))) {
- free(tmp);
+ ast_free(tmp);
tmp = NULL;
} else {
if (!(tmp->ior = ast_calloc(1, (GROW_SHRINK_SIZE / 2) * sizeof(*tmp->ior)))) {
- free(tmp->fds);
- free(tmp);
+ ast_free(tmp->fds);
+ ast_free(tmp);
tmp = NULL;
}
}
@@ -104,11 +104,11 @@ void io_context_destroy(struct io_context *ioc)
{
/* Free associated memory with an I/O context */
if (ioc->fds)
- free(ioc->fds);
+ ast_free(ioc->fds);
if (ioc->ior)
- free(ioc->ior);
+ ast_free(ioc->ior);
- free(ioc);
+ ast_free(ioc);
}
/*! \brief
@@ -250,7 +250,7 @@ int ast_io_remove(struct io_context *ioc, int *_id)
for (x = 0; x < ioc->fdcnt; x++) {
if (ioc->ior[x].id == _id) {
/* Free the int immediately and set to NULL so we know it's unused now */
- free(ioc->ior[x].id);
+ ast_free(ioc->ior[x].id);
ioc->ior[x].id = NULL;
ioc->fds[x].events = 0;
ioc->fds[x].revents = 0;