Commit 5e6d98e7 authored by Hans de Goede's avatar Hans de Goede Committed by Jonas Ådahl

xprops: Use g_new0 instead of calloc in meta_prop_get_motif_hints()

Use g_new0 instead of calloc for motif_hints_from_results and adjust
its callers to use g_free.

Note that in the process_request_frame_extents function this replaces
the wrong original mismatch of calloc + XFree with a matching g_malloc +
g_free pair.

parent 5eaf6552
......@@ -989,7 +989,7 @@ process_request_frame_extents (MetaX11Display *x11_display,
32, PropModeReplace, (guchar*) data, 4);
meta_x11_error_trap_pop (x11_display);
meta_XFree (hints);
g_free (hints);
/* from fvwm2, Copyright Matthias Clasen, Dominik Vogt */
......@@ -313,14 +313,7 @@ motif_hints_from_results (GetPropertyResults *results,
* MotifWmHints than the one we expect, apparently. I'm not sure of
* the history behind it. See bug #89841 for example.
*hints_p = calloc (1, sizeof (MotifWmHints));
if (*hints_p == NULL)
g_free (results->prop);
results->prop = NULL;
return FALSE;
*hints_p = g_new0 (MotifWmHints, 1);
memcpy(*hints_p, results->prop, MIN (sizeof (MotifWmHints),
results->n_items * sizeof (uint32_t)));
......@@ -1085,7 +1078,7 @@ free_value (MetaPropValue *value)
g_free (value->v.str);
free (value->v.motif_hints);
g_free (value->v.motif_hints);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment