Commit 8e510a07 authored by Hans de Goede's avatar Hans de Goede Committed by Jonas Ådahl

xprops: Use g_new0 instead of malloc in size_hints_from_results()

Switch the memory allocation in size_hints_from_results from a malloc call
without error-checking to g_new0 and adjust the free path accordingly.

!786
parent e1535247
......@@ -772,7 +772,7 @@ size_hints_from_results (GetPropertyResults *results,
raw = (xPropSizeHints*) results->prop;
hints = malloc (sizeof (XSizeHints));
hints = g_new0 (XSizeHints, 1);
hints->flags = raw->flags;
hints->x = raw->x;
......@@ -1078,7 +1078,7 @@ free_value (MetaPropValue *value)
g_free (value->v.class_hint.res_name);
break;
case META_PROP_VALUE_SIZE_HINTS:
free (value->v.size_hints.hints);
g_free (value->v.size_hints.hints);
break;
case META_PROP_VALUE_UTF8_LIST:
g_strfreev (value->v.string_list.strings);
......
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