GWin32AppInfo: fix a potential memory leak

Make sure that hndexe_fc_basename is only allocated before it is
actually used.
This commit is contained in:
Руслан Ижбулатов 2019-11-29 16:49:01 +00:00 committed by Philip Withnall
parent 9f070db4c5
commit 9d4d5dfca8

View File

@ -3071,11 +3071,6 @@ link_handlers_to_unregistered_apps (void)
(handler->executable_folded == NULL))
continue;
hndexe_fc_basename = g_utf8_casefold (handler->executable_basename, -1);
if (hndexe_fc_basename == NULL)
continue;
g_hash_table_iter_init (&app_iter, apps_by_id);
while (g_hash_table_iter_next (&app_iter,
@ -3096,6 +3091,11 @@ link_handlers_to_unregistered_apps (void)
if (handler->app != NULL)
continue;
hndexe_fc_basename = g_utf8_casefold (handler->executable_basename, -1);
if (hndexe_fc_basename == NULL)
continue;
g_hash_table_iter_init (&app_iter, apps_by_exe);
while ((hndexe_fc_basename != NULL) &&