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

@@ -80,7 +80,7 @@ static void ast_netsock_destroy(struct ast_netsock *netsock)
{
ast_io_remove(netsock->ioc, netsock->ioref);
close(netsock->sockfd);
free(netsock);
ast_free(netsock);
}
struct ast_netsock_list *ast_netsock_list_alloc(void)
@@ -147,7 +147,7 @@ struct ast_netsock *ast_netsock_bindaddr(struct ast_netsock_list *list, struct i
ast_enable_packet_fragmentation(netsocket);
if (!(ns = ast_calloc(1, sizeof(struct ast_netsock)))) {
if (!(ns = ast_calloc(1, sizeof(*ns)))) {
close(netsocket);
return NULL;
}
@@ -155,7 +155,7 @@ struct ast_netsock *ast_netsock_bindaddr(struct ast_netsock_list *list, struct i
/* Establish I/O callback for socket read */
if (!(ioref = ast_io_add(ioc, netsocket, callback, AST_IO_IN, ns))) {
close(netsocket);
free(ns);
ast_free(ns);
return NULL;
}
ASTOBJ_INIT(ns);