Fix to memory dealocation when creating a slice from a byte buffer