Nice catch :)
Looks like the key logic is missing an overwrite case, the value is reallocated on overwrite.