forked from Mirrors/freeswitch
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
This commit is contained in:
parent
fa56de9d14
commit
d4a2ab28a9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user