mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 21:22:09 +00:00
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:
+1
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user