bpo-46323: Fix double-free issue for borrowed refs (GH-31272)

1 file changed