From e6491bcbb7afc80e4fa8173f55d6000d245b648b Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Mon, 11 Jan 2021 07:03:59 +1100 Subject: [PATCH] Fix bad deallocation of context menus --- v2/internal/ffenestri/contextmenus_darwin.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/v2/internal/ffenestri/contextmenus_darwin.h b/v2/internal/ffenestri/contextmenus_darwin.h index e070912a9..325246bf3 100644 --- a/v2/internal/ffenestri/contextmenus_darwin.h +++ b/v2/internal/ffenestri/contextmenus_darwin.h @@ -62,6 +62,11 @@ int freeContextMenu(void *const context, struct hashmap_element_s *const e) { void DeleteContextMenuStore(ContextMenuStore* store) { + // Guard against NULLs + if( store == NULL ) { + return; + } + // Delete context menus if( hashmap_num_entries(&store->contextMenuStore) > 0 ) { if (0 != hashmap_iterate_pairs(&store->contextMenuStore, freeContextMenu, NULL)) {