From a50eaab1e644445eaa1f9c92ef496b52d1531634 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 1 Feb 2024 22:00:26 +0900 Subject: [PATCH] [cmem] Allow delete_memsuper on null memsuper While not done for freeing cmem blocks, it helps clean up shutdown code when the memsuper may not have been created. --- libs/util/cmem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/util/cmem.c b/libs/util/cmem.c index 9b13a4b6e..62fbc2dae 100644 --- a/libs/util/cmem.c +++ b/libs/util/cmem.c @@ -413,6 +413,9 @@ new_memsuper (void) void delete_memsuper (memsuper_t *super) { + if (!super) { + return; + } // The block holding the superblock is always the last block in the list while (super->memblocks && super->memblocks->next) { memblock_t *t = super->memblocks;