Comment 2 for bug 1926298

Revision history for this message
Dan Bungert (dbungert) wrote :

Root cause:
The goto out for cleanup can skip a variable initialization, so in some cases we
crash on if(pathdirs) g_strfreev(pathdirs); because pathdirs is declared too
late and, in that code flow, never initialized.

We could thus also fix this by ensuring that pathdirs is properly initialized
at the beginning of the function, but removing the reimplementation of
g_find_program_in_path is the superior solution.

Attached is my proposed fix, however I don't think we should upload yet since there appear to be some parallel work going on in https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/1883315