xprops: Use g_free instead of XFree in text_property_from_results()

results->prop is g_malloc memory so it should be free-ed with g_free not
XFree. The same applies to the return value of text_property_from_results
itself.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/786
This commit is contained in:
Hans de Goede 2019-09-09 16:06:08 +02:00 committed by Jonas Ådahl
parent 488991b0f6
commit 89cd9d382d

View File

@ -659,15 +659,13 @@ text_property_from_results (GetPropertyResults *results,
*utf8_str_p = NULL;
tp.value = results->prop;
results->prop = NULL;
tp.encoding = results->type;
tp.format = results->format;
tp.nitems = results->n_items;
*utf8_str_p = text_property_to_utf8 (results->x11_display->xdisplay, &tp);
if (tp.value != NULL)
XFree (tp.value);
g_clear_pointer (&results->prop, g_free);
return *utf8_str_p != NULL;
}
@ -1088,7 +1086,7 @@ free_value (MetaPropValue *value)
g_free (value->v.atom_list.atoms);
break;
case META_PROP_VALUE_TEXT_PROPERTY:
free (value->v.str);
g_free (value->v.str);
break;
case META_PROP_VALUE_WM_HINTS:
free (value->v.wm_hints);