Use c malloced pointer for function references