aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/memorypool.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/memorypool.c')
-rw-r--r--src/microhttpd/memorypool.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/microhttpd/memorypool.c b/src/microhttpd/memorypool.c
index fbc94659..41503f63 100644
--- a/src/microhttpd/memorypool.c
+++ b/src/microhttpd/memorypool.c
@@ -470,7 +470,7 @@ MHD_pool_is_resizable_inplace (struct MemoryPool *pool,
470 * @param size the size of memory in bytes to allocate 470 * @param size the size of memory in bytes to allocate
471 * @param[out] required_bytes the pointer to variable to be updated with 471 * @param[out] required_bytes the pointer to variable to be updated with
472 * the size of the required additional free 472 * the size of the required additional free
473 * memory area, not updated if function succeed. 473 * memory area, set to 0 if function succeeds.
474 * Cannot be NULL. 474 * Cannot be NULL.
475 * @return the pointer to allocated memory area if succeed, 475 * @return the pointer to allocated memory area if succeed,
476 * NULL if the pool doesn't have enough space, required_bytes is updated 476 * NULL if the pool doesn't have enough space, required_bytes is updated
@@ -504,6 +504,7 @@ MHD_pool_try_alloc (struct MemoryPool *pool,
504 *required_bytes = SIZE_MAX; 504 *required_bytes = SIZE_MAX;
505 return NULL; 505 return NULL;
506 } 506 }
507 *required_bytes = 0;
507 ret = &pool->memory[pool->end - asize]; 508 ret = &pool->memory[pool->end - asize];
508 pool->end -= asize; 509 pool->end -= asize;
509 _MHD_UNPOISON_MEMORY (ret, size); 510 _MHD_UNPOISON_MEMORY (ret, size);