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++;
|
||||
break;
|
||||
} else if ((*bucketPtr)->key == key) {
|
||||
if (this->owner)
|
||||
if (this->owner && (*bucketPtr)->value != value)
|
||||
free((*bucketPtr)->value);
|
||||
(*bucketPtr)->value = value;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue