mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-24 00:39:53 +00:00
no-pool-big-enough was not correctly caught
This commit is contained in:
parent
0ce27296aa
commit
786a7fbaf4
@ -71,14 +71,14 @@ void *
|
|||||||
mem_malloc(mem_size_t size)
|
mem_malloc(mem_size_t size)
|
||||||
{
|
{
|
||||||
struct mem_helper *element;
|
struct mem_helper *element;
|
||||||
int poolnr = -1;
|
int poolnr;
|
||||||
|
|
||||||
for (poolnr = MEMP_MEM_POOL_1; poolnr < (MEMP_MEM_POOL_1 + MEM_POOL_COUNT); 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]) {
|
if ((size + sizeof(struct mem_helper)) <= memp_sizes[poolnr]) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (poolnr == -1) {
|
if (poolnr == MEMP_MAX) {
|
||||||
LWIP_ASSERT("mem_malloc(): no pool is that big!", 0);
|
LWIP_ASSERT("mem_malloc(): no pool is that big!", 0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user