wrowe@apache.org writes:
> @@ -625,13 +629,19 @@
> * Memory allocation
> */
>
> -APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size)
> +APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t in_size)
> {
> apr_memnode_t *active, *node;
> void *mem;
> apr_uint32_t free_index;
> + apr_size_t size;
>
> - size = APR_ALIGN_DEFAULT(size);
> + size = APR_ALIGN_DEFAULT(in_size);
> + if (size < in_size) {
> + if (pool->abort_fn)
> + pool->abort_fn(APR_ENOMEM);
> +
> + }
> active = pool->active;
>
> /* If the active node has enough bytes left, use it. */
Should this case be returning NULL as in the other branches?
--
Dan Poirier <poirier@pobox.com>
|