BUG: fix leak and possible use after free

not sure if this is the right thing, but it looks like assigning data1 to both entries was a typo.
Its probably harmless but would cause issues if one metadata is freed while the other is still needed.