diff options
author | Corentin Noël <corentin@elementary.io> | 2018-07-09 16:43:47 +0200 |
---|---|---|
committer | Corentin Noël <corentin@elementary.io> | 2018-07-09 16:43:47 +0200 |
commit | f35ce260bd982d96510af44c733b629cc5bbabcf (patch) | |
tree | 3bf408a32e7fda412c2bc0ee3032b3c6f474daab | |
parent | c8f1baf5595e137748836e2c7443d1fef814049c (diff) | |
download | gnome-control-center-wip/tintou/fix-free.tar.gz |
common: fix some wrong autofree useswip/tintou/fix-free
g_autofree an array only g_free the first element, GStrv is the string array type.
-rw-r--r-- | shell/cc-window.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/shell/cc-window.c b/shell/cc-window.c index 382db54e1..6afff2a7a 100644 --- a/shell/cc-window.c +++ b/shell/cc-window.c @@ -328,7 +328,7 @@ setup_model (CcWindow *shell) g_autofree gchar *description = NULL; g_autofree gchar *id = NULL; g_autofree gchar *icon_name = NULL; - g_autofree GStrv keywords = NULL; + g_auto(GStrv) keywords = NULL; CcPanelVisibility visibility; gtk_tree_model_get (model, &iter, @@ -537,7 +537,7 @@ gdk_window_set_cb (GObject *object, CcWindow *self) { GdkWindow *window; - gchar *str; + g_autofree gchar *str = NULL; if (!GDK_IS_X11_DISPLAY (gdk_display_get_default ())) return; @@ -549,7 +549,6 @@ gdk_window_set_cb (GObject *object, str = g_strdup_printf ("%u", (guint) GDK_WINDOW_XID (window)); g_setenv ("GNOME_CONTROL_CENTER_XID", str, TRUE); - g_free (str); } static gboolean @@ -641,7 +640,7 @@ split_decorations_cb (GtkSettings *settings, g_autofree gchar *layout = NULL; g_autofree gchar *layout_start = NULL; g_autofree gchar *layout_end = NULL; - g_autofree gchar **buttons; + g_auto(GStrv) buttons = NULL; g_object_get (settings, "gtk-decoration-layout", &layout, NULL); |