function pointers to malloc and free