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:
parent
488991b0f6
commit
89cd9d382d
@ -659,15 +659,13 @@ text_property_from_results (GetPropertyResults *results,
|
|||||||
*utf8_str_p = NULL;
|
*utf8_str_p = NULL;
|
||||||
|
|
||||||
tp.value = results->prop;
|
tp.value = results->prop;
|
||||||
results->prop = NULL;
|
|
||||||
tp.encoding = results->type;
|
tp.encoding = results->type;
|
||||||
tp.format = results->format;
|
tp.format = results->format;
|
||||||
tp.nitems = results->n_items;
|
tp.nitems = results->n_items;
|
||||||
|
|
||||||
*utf8_str_p = text_property_to_utf8 (results->x11_display->xdisplay, &tp);
|
*utf8_str_p = text_property_to_utf8 (results->x11_display->xdisplay, &tp);
|
||||||
|
|
||||||
if (tp.value != NULL)
|
g_clear_pointer (&results->prop, g_free);
|
||||||
XFree (tp.value);
|
|
||||||
|
|
||||||
return *utf8_str_p != NULL;
|
return *utf8_str_p != NULL;
|
||||||
}
|
}
|
||||||
@ -1088,7 +1086,7 @@ free_value (MetaPropValue *value)
|
|||||||
g_free (value->v.atom_list.atoms);
|
g_free (value->v.atom_list.atoms);
|
||||||
break;
|
break;
|
||||||
case META_PROP_VALUE_TEXT_PROPERTY:
|
case META_PROP_VALUE_TEXT_PROPERTY:
|
||||||
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);
|
free (value->v.wm_hints);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user