1
0
Fork 0

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:
Hans de Goede 2019-09-09 11:08:25 +02:00 committed by Jonas Ådahl
parent 89cd9d382d
commit eb8a1f42bc

View file

@ -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);