You will need to use free() to deallocate the returned pointer. For this reason, the function can be programmed to always return NULL. Use mod_pane2d_dupimage instead.
Global mod_pane_to_output2d (pane2d_handle pane, pane2d_dupdata dupdata, pane2d_dupxy dupxy, int use_rgb)