mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 17:10:40 -05:00
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
This commit is contained in:
parent
645d596f9d
commit
1d75d5aa2f
@ -41,7 +41,7 @@ static MetaGroup*
|
|||||||
meta_group_new (MetaX11Display *x11_display,
|
meta_group_new (MetaX11Display *x11_display,
|
||||||
Window group_leader)
|
Window group_leader)
|
||||||
{
|
{
|
||||||
MetaGroup *group;
|
g_autofree MetaGroup *group = NULL;
|
||||||
#define N_INITIAL_PROPS 3
|
#define N_INITIAL_PROPS 3
|
||||||
Atom initial_props[N_INITIAL_PROPS];
|
Atom initial_props[N_INITIAL_PROPS];
|
||||||
int i;
|
int i;
|
||||||
@ -91,7 +91,7 @@ meta_group_new (MetaX11Display *x11_display,
|
|||||||
"Created new group with leader 0x%lx\n",
|
"Created new group with leader 0x%lx\n",
|
||||||
group->group_leader);
|
group->group_leader);
|
||||||
|
|
||||||
return group;
|
return g_steal_pointer (&group);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user