From 1d75d5aa2f5e5a7b14573489877e143f6a06cf5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 9 Jul 2019 11:17:18 +0200 Subject: [PATCH] group: Free group if returning early If we get an error when fetching the window attributes, the group isn't ever free'd, so use an autopointer instead, releasing the stolen one. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1195 --- src/x11/group.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x11/group.c b/src/x11/group.c index a3227467f..60f2d2902 100644 --- a/src/x11/group.c +++ b/src/x11/group.c @@ -41,7 +41,7 @@ static MetaGroup* meta_group_new (MetaX11Display *x11_display, Window group_leader) { - MetaGroup *group; + g_autofree MetaGroup *group = NULL; #define N_INITIAL_PROPS 3 Atom initial_props[N_INITIAL_PROPS]; int i; @@ -91,7 +91,7 @@ meta_group_new (MetaX11Display *x11_display, "Created new group with leader 0x%lx\n", group->group_leader); - return group; + return g_steal_pointer (&group); } static void