[asterisk-commits] trunk r14000 - /trunk/include/asterisk/module.h

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Mar 21 12:19:36 MST 2006


Author: russell
Date: Tue Mar 21 13:19:35 2006
New Revision: 14000

URL: http://svn.digium.com/view/asterisk?rev=14000&view=rev
Log:
update LOCAL_USER_ADD to use ast_calloc

Modified:
    trunk/include/asterisk/module.h

Modified: trunk/include/asterisk/module.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/module.h?rev=14000&r1=13999&r2=14000&view=diff
==============================================================================
--- trunk/include/asterisk/module.h (original)
+++ trunk/include/asterisk/module.h Tue Mar 21 13:19:35 2006
@@ -25,6 +25,8 @@
 
 #ifndef _ASTERISK_MODULE_H
 #define _ASTERISK_MODULE_H
+
+#include "asterisk/utils.h"
 
 #if defined(__cplusplus) || defined(c_plusplus)
 extern "C" {
@@ -318,10 +320,8 @@
  */
 #define LOCAL_USER_ADD(u) { \
  \
-	if (!(u=calloc(1,sizeof(*u)))) { \
-		ast_log(LOG_WARNING, "Out of memory\n"); \
+	if (!(u = ast_calloc(1, sizeof(*u)))) \
 		return -1; \
-	} \
 	ast_mutex_lock(&localuser_lock); \
 	u->chan = chan; \
 	u->next = localusers; \



More information about the asterisk-commits mailing list