Added rad_calloc to mirror rad_malloc
[freeradius.git] / src / main / util.c
index 9c27bad..94ee443 100644 (file)
@@ -347,13 +347,21 @@ void *rad_malloc(size_t size)
        void *ptr = malloc(size);
 
        if (ptr == NULL) {
-               radlog(L_ERR|L_CONS, "no memory");
+               radlog(L_ERR, "no memory");
                exit(1);
        }
 
        return ptr;
 }
 
+
+void *rad_calloc(size_t size)
+{
+       void *ptr = rad_malloc(size);
+       memset(ptr, 0, size);
+       return ptr;
+}
+
 /*
  *     Logs an error message and aborts the program
  *