summaryrefslogtreecommitdiffstats
path: root/Hashtable.c
diff options
context:
space:
mode:
authorFynn Wulf <fynn_wulf@gmx.de>2020-10-08 22:48:35 +0200
committercgzones <cgzones@googlemail.com>2020-10-09 12:23:16 +0200
commite5fdb80c7d13d836ec244390976741dd99bc6535 (patch)
tree1f373485c315d45265810f28b1b75c2cfb2f73c0 /Hashtable.c
parentf4439b1b60be6e0cb0bfeb9fbbcd9952f0d66120 (diff)
Fix Hashtable_put to allow storing the same pointer
Diffstat (limited to 'Hashtable.c')
-rw-r--r--Hashtable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Hashtable.c b/Hashtable.c
index d032ba77..383b34a8 100644
--- a/Hashtable.c
+++ b/Hashtable.c
@@ -88,7 +88,7 @@ void Hashtable_put(Hashtable* this, unsigned int key, void* value) {
this->items++;
break;
} else if ((*bucketPtr)->key == key) {
- if (this->owner)
+ if (this->owner && (*bucketPtr)->value != value)
free((*bucketPtr)->value);
(*bucketPtr)->value = value;
break;

© 2014-2024 Faster IT GmbH | imprint | privacy policy