[gnome-builder] command-bar: don't leak action names



commit 5af24a1e40a9ce360e76826ed97b0df27e25a38b
Author: Christian Hergert <chergert redhat com>
Date:   Wed Oct 12 19:08:25 2016 -0700

    command-bar: don't leak action names
    
    We were freeing the container, but not the individual strings.

 plugins/command-bar/gb-command-gaction-provider.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/plugins/command-bar/gb-command-gaction-provider.c 
b/plugins/command-bar/gb-command-gaction-provider.c
index ff948ea..390ada7 100644
--- a/plugins/command-bar/gb-command-gaction-provider.c
+++ b/plugins/command-bar/gb-command-gaction-provider.c
@@ -434,7 +434,7 @@ gb_command_gaction_provider_complete (GbCommandProvider *provider,
       GbGroup *gb_group = iter->data;
       GActionGroup *group = gb_group->group;
       gchar *prefix = gb_group->prefix;
-      gchar **names;
+      g_auto(GStrv) names = NULL;
       const gchar *command_name;
       guint i;
 
@@ -456,8 +456,6 @@ gb_command_gaction_provider_complete (GbCommandProvider *provider,
               g_action_group_get_action_enabled (group, names [i]))
             g_ptr_array_add (completions, g_strdup (names [i]));
         }
-
-      g_free (names);
     }
 
   g_list_free_full (groups, (GDestroyNotify)gb_group_free);


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