diff options
author | Fynn Wulf <fynn_wulf@gmx.de> | 2020-10-08 22:48:35 +0200 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2020-10-09 12:23:16 +0200 |
commit | e5fdb80c7d13d836ec244390976741dd99bc6535 (patch) | |
tree | 1f373485c315d45265810f28b1b75c2cfb2f73c0 /Hashtable.c | |
parent | f4439b1b60be6e0cb0bfeb9fbbcd9952f0d66120 (diff) |
Fix Hashtable_put to allow storing the same pointer
Diffstat (limited to 'Hashtable.c')
-rw-r--r-- | Hashtable.c | 2 |
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; |