From 78e4a6d902139c018338a9e423fc6c95ce78f2d8 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Mon, 23 May 2022 20:17:25 +0000 Subject: [PATCH] pseudomap: dont crash on destroy if map is null the previous contract for orderedlist was that orderedmap_destroy() can be called with a NULL pointer. --- src/pseudomap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pseudomap.c b/src/pseudomap.c index 73bcaff..3b62e5b 100644 --- a/src/pseudomap.c +++ b/src/pseudomap.c @@ -28,6 +28,7 @@ pseudomap *pseudomap_create(void) { } void pseudomap_destroy(pseudomap *o) { + if(!o) return; while(sblist_getsize(o)) { /* retrieve latest element, and "shrink" list in place, so we don't have to constantly rearrange list items