[asterisk-commits] trunk r26166 - /trunk/netsock.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue May 9 09:19:25 MST 2006


Author: rizzo
Date: Tue May  9 11:19:24 2006
New Revision: 26166

URL: http://svn.digium.com/view/asterisk?rev=26166&view=rev
Log:
clear memory before passing to ASTOBJ_INIT
Mayne it is unnecessary, but otherwise there code believes
the mutex is already initialized.


Modified:
    trunk/netsock.c

Modified: trunk/netsock.c
URL: http://svn.digium.com/view/asterisk/trunk/netsock.c?rev=26166&r1=26165&r2=26166&view=diff
==============================================================================
--- trunk/netsock.c (original)
+++ trunk/netsock.c Tue May  9 11:19:24 2006
@@ -149,7 +149,7 @@
 	if (setsockopt(netsocket, IPPROTO_IP, IP_TOS, &tos, sizeof(tos))) 
 		ast_log(LOG_WARNING, "Unable to set TOS to %d\n", tos);
 
-	ns = malloc(sizeof(struct ast_netsock));
+	ns = ast_calloc(1, sizeof(struct ast_netsock));
 	if (ns) {
 		/* Establish I/O callback for socket read */
 		ioref = ast_io_add(ioc, netsocket, callback, AST_IO_IN, ns);



More information about the asterisk-commits mailing list