mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-28 18:16:13 +00:00
memp: Check for null in memp_free
When memp_free_pool was split out from memp_free (c838e1ed5b
),
the check for freeing the null pointer was lost.
This resulted in the null value being put back in the list of free
objects, causing all subsequent allocations of that type to fail.
This commit is contained in:
parent
7d8989e3ea
commit
a82ec4499f
@ -471,6 +471,10 @@ memp_free(memp_t type, void *mem)
|
||||
|
||||
LWIP_ERROR("memp_free: type < MEMP_MAX", (type < MEMP_MAX), return;);
|
||||
|
||||
if (mem == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if MEMP_OVERFLOW_CHECK >= 2
|
||||
memp_overflow_check_all();
|
||||
#endif /* MEMP_OVERFLOW_CHECK >= 2 */
|
||||
|
Loading…
Reference in New Issue
Block a user