Fix stats_display_memp() to avoid accessing NULLs

It's possible for pool pointers to be NULL.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
Shawn Silverman
2023-08-22 14:44:50 -07:00
committed by Simon Goldschmidt
parent 13d7ac3363
commit 5d32779c1b

View File

@@ -116,7 +116,11 @@ void
stats_display_memp(struct stats_mem *mem, int idx)
{
if (idx < MEMP_MAX) {
stats_display_mem(mem, mem->name);
if (mem == NULL) {
LWIP_PLATFORM_DIAG(("\nMEMP[%d]: NULL\n", idx));
} else {
stats_display_mem(mem, mem->name);
}
}
}
#endif /* MEMP_STATS */