Replace hashtable key if a put operation replaces value

Fixes a crash if lifetime of key is bound to value (i.e. key == value)
This commit is contained in:
Martin Willi
2011-02-03 17:09:09 +01:00
parent bf3e482141
commit 7e0eae4985
+1
View File
@@ -249,6 +249,7 @@ METHOD(hashtable_t, put, void*,
{
old_value = pair->value;
pair->value = value;
pair->key = key;
break;
}
}