mirror of https://github.com/xzeldon/htop.git
Fix Hashtable_put to allow storing the same pointer
This commit is contained in:
parent
f4439b1b60
commit
e5fdb80c7d
|
@ -88,7 +88,7 @@ void Hashtable_put(Hashtable* this, unsigned int key, void* value) {
|
||||||
this->items++;
|
this->items++;
|
||||||
break;
|
break;
|
||||||
} else if ((*bucketPtr)->key == key) {
|
} else if ((*bucketPtr)->key == key) {
|
||||||
if (this->owner)
|
if (this->owner && (*bucketPtr)->value != value)
|
||||||
free((*bucketPtr)->value);
|
free((*bucketPtr)->value);
|
||||||
(*bucketPtr)->value = value;
|
(*bucketPtr)->value = value;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue