提交 d4a2ab28 authored 作者: Michael Jerris's avatar Michael Jerris

return error instead of segfaulting on pool allocation failure when creating a queue.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7307 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 fa56de9d
......@@ -126,7 +126,9 @@ APU_DECLARE(apr_status_t) apr_queue_create(apr_queue_t **q,
}
/* Set all the data in the queue to NULL */
queue->data = apr_pcalloc(a, queue_capacity * sizeof(void*));
queue->data = apr_palloc(a, queue_capacity * sizeof(void*));
if (!queue->data) return APR_ENOMEM;
memset(queue->data, 0, queue_capacity * sizeof(void*));
queue->bounds = queue_capacity;
queue->nelts = 0;
queue->in = 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论