mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
xprops: Use g_new0 instead of malloc in size_hints_from_results()
Switch the memory allocation in size_hints_from_results from a malloc call without error-checking to g_new0 and adjust the free path accordingly. https://gitlab.gnome.org/GNOME/mutter/merge_requests/786
This commit is contained in:
parent
e153524748
commit
8e510a07c4
@ -772,7 +772,7 @@ size_hints_from_results (GetPropertyResults *results,
|
|||||||
|
|
||||||
raw = (xPropSizeHints*) results->prop;
|
raw = (xPropSizeHints*) results->prop;
|
||||||
|
|
||||||
hints = malloc (sizeof (XSizeHints));
|
hints = g_new0 (XSizeHints, 1);
|
||||||
|
|
||||||
hints->flags = raw->flags;
|
hints->flags = raw->flags;
|
||||||
hints->x = raw->x;
|
hints->x = raw->x;
|
||||||
@ -1078,7 +1078,7 @@ free_value (MetaPropValue *value)
|
|||||||
g_free (value->v.class_hint.res_name);
|
g_free (value->v.class_hint.res_name);
|
||||||
break;
|
break;
|
||||||
case META_PROP_VALUE_SIZE_HINTS:
|
case META_PROP_VALUE_SIZE_HINTS:
|
||||||
free (value->v.size_hints.hints);
|
g_free (value->v.size_hints.hints);
|
||||||
break;
|
break;
|
||||||
case META_PROP_VALUE_UTF8_LIST:
|
case META_PROP_VALUE_UTF8_LIST:
|
||||||
g_strfreev (value->v.string_list.strings);
|
g_strfreev (value->v.string_list.strings);
|
||||||
|
Loading…
Reference in New Issue
Block a user