Revert "Allocate/deallocate memory for storing selections instead of relying on caller's data"
We don't want to copy this data unnecessarily. Better take care of allocating memory in internal functions that copy selections when it's really necessary.

This reverts commit 233843b791aa031f3d391c2cfbcd6bbf4f985792.