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 /main/io.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 'main/io.c')
-rw-r--r-- | main/io.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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; |