xprops: Free meta_prop_get_cardinal_list() return value with g_free()

meta_prop_get_cardinal_list directly passes through the results->prop
pointer which is g_malloc memory, so we should free the buffer it
returns with g_free.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/786
This commit is contained in:
Hans de Goede 2019-09-09 18:36:48 +02:00 committed by Jonas Ådahl
parent 2c1553570f
commit 5eaf655224
3 changed files with 5 additions and 5 deletions

View File

@ -1320,7 +1320,7 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
&list, &n_items))
{
num = list[0];
meta_XFree (list);
g_free (list);
}
if (num > meta_workspace_manager_get_n_workspaces (display->workspace_manager))
@ -2186,7 +2186,7 @@ meta_x11_display_update_workspace_layout (MetaX11Display *x11_display)
"(3 is accepted for backwards compat)\n", n_items);
}
meta_XFree (list);
g_free (list);
meta_workspace_manager_update_workspace_layout (workspace_manager,
starting_corner,

View File

@ -1637,7 +1637,7 @@ meta_window_x11_update_struts (MetaWindow *window)
struts[0], struts[1], struts[2], struts[3],
window->desc);
}
meta_XFree (struts);
g_free (struts);
}
else
{
@ -1696,7 +1696,7 @@ meta_window_x11_update_struts (MetaWindow *window)
struts[0], struts[1], struts[2], struts[3],
window->desc);
}
meta_XFree (struts);
g_free (struts);
}
else if (!new_struts)
{

View File

@ -1111,7 +1111,7 @@ free_value (MetaPropValue *value)
g_strfreev (value->v.string_list.strings);
break;
case META_PROP_VALUE_CARDINAL_LIST:
free (value->v.cardinal_list.cardinals);
g_free (value->v.cardinal_list.cardinals);
break;
case META_PROP_VALUE_SYNC_COUNTER:
break;