https://github.com/libsdl-org/Maelstrom/commit/dc581e2ed66861bd3099b58bcf2301ff6d52a3fe
From dc581e2ed66861bd3099b58bcf2301ff6d52a3fe Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 4 Nov 2011 21:46:04 -0400
Subject: [PATCH] Fixed dangling reference when removing an item from the hash
table.
---
utils/hashtable.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/utils/hashtable.c b/utils/hashtable.c
index 048505c5..8e9d980e 100644
--- a/utils/hashtable.c
+++ b/utils/hashtable.c
@@ -141,6 +141,9 @@ int hash_remove(HashTable *table, const void *key)
if (item->global_prev)
item->global_prev->global_next = item->global_next;
+ else
+ table->list = item->global_next;
+
if (item->global_next)
item->global_next->global_prev = item->global_prev;