You've misinterpreted the API docs. g_find_program_in_path() *always* returns a newly allocated string.
You've misinterpreted the API docs. g_find_ program_ in_path( ) *always* returns a newly allocated string.