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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
hints = calloc (1, sizeof (XWMHints));
|
hints = g_new0 (XWMHints, 1);
|
||||||
|
|
||||||
raw = (xPropWMHints*) results->prop;
|
raw = (xPropWMHints*) results->prop;
|
||||||
|
|
||||||
@ -1089,7 +1089,7 @@ free_value (MetaPropValue *value)
|
|||||||
g_free (value->v.str);
|
g_free (value->v.str);
|
||||||
break;
|
break;
|
||||||
case META_PROP_VALUE_WM_HINTS:
|
case META_PROP_VALUE_WM_HINTS:
|
||||||
free (value->v.wm_hints);
|
g_free (value->v.wm_hints);
|
||||||
break;
|
break;
|
||||||
case META_PROP_VALUE_CLASS_HINT:
|
case META_PROP_VALUE_CLASS_HINT:
|
||||||
free (value->v.class_hint.res_class);
|
free (value->v.class_hint.res_class);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user