summaryrefslogtreecommitdiff
path: root/src/x11
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2019-09-09 16:06:08 +0200
committerJonas Ã…dahl <jadahl@gmail.com>2019-10-03 17:20:54 +0000
commit89cd9d382dc1aea24cb5e5714276d15d1bbfa741 (patch)
treec9ecf8474fc972754938c846d028c32f3bbae5c9 /src/x11
parent488991b0f6f6cca3cfc780407d99855477d7ae1b (diff)
downloadmutter-89cd9d382dc1aea24cb5e5714276d15d1bbfa741.tar.gz
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
Diffstat (limited to 'src/x11')
-rw-r--r--src/x11/xprops.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/x11/xprops.c b/src/x11/xprops.c
index 3632877da..f62222e2e 100644
--- a/src/x11/xprops.c
+++ b/src/x11/xprops.c
@@ -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);