aboutsummaryrefslogtreecommitdiffstats
path: root/main/netsock.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-06 21:20:11 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-06 21:20:11 +0000
commiteb5d461ed4688cafadc76bebf329a2fae454dc12 (patch)
tree5503cb153c9de46c07e3a0a521cc996926ed375b /main/netsock.c
parent125558c76fd4870a9133e4974cce6410c89a3593 (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/netsock.c')
-rw-r--r--main/netsock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/netsock.c b/main/netsock.c
index 2ce60b8c4..e57c376ee 100644
--- a/main/netsock.c
+++ b/main/netsock.c
@@ -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);