mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -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;
|
||||
|
||||
hints = malloc (sizeof (XSizeHints));
|
||||
hints = g_new0 (XSizeHints, 1);
|
||||
|
||||
hints->flags = raw->flags;
|
||||
hints->x = raw->x;
|
||||
@ -1078,7 +1078,7 @@ free_value (MetaPropValue *value)
|
||||
g_free (value->v.class_hint.res_name);
|
||||
break;
|
||||
case META_PROP_VALUE_SIZE_HINTS:
|
||||
free (value->v.size_hints.hints);
|
||||
g_free (value->v.size_hints.hints);
|
||||
break;
|
||||
case META_PROP_VALUE_UTF8_LIST:
|
||||
g_strfreev (value->v.string_list.strings);
|
||||
|
Loading…
Reference in New Issue
Block a user