Pointer to function and allocation