Fix Hashtable_put to allow storing the same pointer

main
Fynn Wulf 6 years ago committed by cgzones
parent f4439b1b60
commit e5fdb80c7d
  1. 2
      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;

Loading…
Cancel
Save