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:
Erik Ekman 2016-11-03 12:13:05 +01:00
parent 7d8989e3ea
commit a82ec4499f

View File

@ -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 */