switch_malloc and switch_zmalloc macros that are fatal if malloc fails both in debug and release modes, switch_zmalloc includes a companion memset for the malloc'd block.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4794 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2007-03-29 17:37:42 +00:00
parent 6e2b76eb75
commit a021945cef
3 changed files with 16 additions and 10 deletions
+1 -2
View File
@@ -377,8 +377,7 @@ SWITCH_DECLARE(uint32_t) switch_core_scheduler_add_task(time_t task_runtime,
switch_core_scheduler_task_container_t *container, *tp;
switch_mutex_lock(runtime.task_mutex);
assert((container = malloc(sizeof(*container))));
memset(container, 0, sizeof(*container));
switch_zmalloc(container, sizeof(*container));
assert(func);
container->func = func;
time(&container->task.created);