mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 20:32:16 +00:00
xprops: Use g_new0 instead of calloc in wm_hints_from_results()
Switch the memory allocation in wm_hints_from_results from a calloc call without error-checking to g_new0 and just the free path accordingly. https://gitlab.gnome.org/GNOME/mutter/merge_requests/786
This commit is contained in:
parent
89cd9d382d
commit
eb8a1f42bc
@ -695,7 +695,7 @@ wm_hints_from_results (GetPropertyResults *results,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
hints = calloc (1, sizeof (XWMHints));
|
||||
hints = g_new0 (XWMHints, 1);
|
||||
|
||||
raw = (xPropWMHints*) results->prop;
|
||||
|
||||
@ -1089,7 +1089,7 @@ free_value (MetaPropValue *value)
|
||||
g_free (value->v.str);
|
||||
break;
|
||||
case META_PROP_VALUE_WM_HINTS:
|
||||
free (value->v.wm_hints);
|
||||
g_free (value->v.wm_hints);
|
||||
break;
|
||||
case META_PROP_VALUE_CLASS_HINT:
|
||||
free (value->v.class_hint.res_class);
|
||||
|
Loading…
Reference in New Issue
Block a user