pass pointers to functions that expect pointers. fixed possible leak