[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 02/02: MemoryPool: realloc: do not move old buffer point
From: |
gnunet |
Subject: |
[libmicrohttpd] 02/02: MemoryPool: realloc: do not move old buffer pointer even if buffer size is zero |
Date: |
Sun, 10 Oct 2021 20:51:05 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit c2b4cb4a968b8d2dc291cda5ae48f872f63e1256
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sat Oct 9 17:25:11 2021 +0300
MemoryPool: realloc: do not move old buffer pointer even if buffer size is
zero
---
src/microhttpd/memorypool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/microhttpd/memorypool.c b/src/microhttpd/memorypool.c
index 0f71ab1b..ffcaab43 100644
--- a/src/microhttpd/memorypool.c
+++ b/src/microhttpd/memorypool.c
@@ -425,7 +425,7 @@ MHD_pool_reallocate (struct MemoryPool *pool,
(size_t) (((uint8_t*) old) - pool->memory) + old_size <= \
pool->end - _MHD_RED_ZONE_SIZE);
- if (0 != old_size)
+ if (NULL != old)
{ /* Have previously allocated data */
const size_t old_offset = (uint8_t*) old - pool->memory;
const bool shrinking = (old_size > new_size);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.