From eb8a1f42bc1389d3b319f77fc1cf3ecd5e6586f5 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 9 Sep 2019 11:08:25 +0200 Subject: [PATCH] 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 --- src/x11/xprops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x11/xprops.c b/src/x11/xprops.c index f62222e2e..d32bb263f 100644 --- a/src/x11/xprops.c +++ b/src/x11/xprops.c @@ -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);