[svn-commits] trunk r37733 - /trunk/manager.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sun Jul 16 12:35:10 MST 2006


Author: russell
Date: Sun Jul 16 14:35:09 2006
New Revision: 37733

URL: http://svn.digium.com/view/asterisk?rev=37733&view=rev
Log:
malloc + memset to ast_calloc

Modified:
    trunk/manager.c

Modified: trunk/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/manager.c?rev=37733&r1=37732&r2=37733&view=diff
==============================================================================
--- trunk/manager.c (original)
+++ trunk/manager.c Sun Jul 16 14:35:09 2006
@@ -1909,12 +1909,9 @@
 				ast_log(LOG_WARNING, "Failed to set manager tcp connection to TCP_NODELAY mode: %s\n", strerror(errno));
 			}
 		}
-		s = malloc(sizeof(struct mansession));
-		if (!s) {
-			ast_log(LOG_WARNING, "Failed to allocate management session: %s\n", strerror(errno));
+		if (!(s = ast_calloc(1, sizeof(*s))))
 			continue;
-		} 
-		memset(s, 0, sizeof(struct mansession));
+		
 		memcpy(&s->sin, &sin, sizeof(sin));
 		s->writetimeout = 100;
 		s->waiting_thread = AST_PTHREADT_NULL;



More information about the svn-commits mailing list