From 786a7fbaf474bdb2140a732db2ee98ee724958fc Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 22 Jun 2007 20:26:30 +0000 Subject: [PATCH] no-pool-big-enough was not correctly caught --- src/core/mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/mem.c b/src/core/mem.c index ca947a74..5779f4f7 100644 --- a/src/core/mem.c +++ b/src/core/mem.c @@ -71,14 +71,14 @@ void * mem_malloc(mem_size_t size) { struct mem_helper *element; - int poolnr = -1; + int poolnr; for (poolnr = MEMP_MEM_POOL_1; poolnr < (MEMP_MEM_POOL_1 + MEM_POOL_COUNT); poolnr++) { if ((size + sizeof(struct mem_helper)) <= memp_sizes[poolnr]) { break; } } - if (poolnr == -1) { + if (poolnr == MEMP_MAX) { LWIP_ASSERT("mem_malloc(): no pool is that big!", 0); return NULL; }