[glib: 2/3] GWin32AppInfo: fix a potential memory leak



commit 9d4d5dfca899548aebb3b4ed4238ea62d247556a
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Fri Nov 29 16:49:01 2019 +0000

    GWin32AppInfo: fix a potential memory leak
    
    Make sure that hndexe_fc_basename is only allocated before it is
    actually used.

 gio/gwin32appinfo.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gio/gwin32appinfo.c b/gio/gwin32appinfo.c
index eb53ed872..446d88e52 100644
--- a/gio/gwin32appinfo.c
+++ b/gio/gwin32appinfo.c
@@ -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) &&


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]