xprops: Free latin1/utf8_string_from_results() return value with g_free()
latin1_string_from_results and utf8_string_from_results use g_strndup, so the returned string should be freed with g_free, rather then with free or XFree. This fixes all free-s of buffers returned by these 2 functions to properly use g_free. https://gitlab.gnome.org/GNOME/mutter/merge_requests/786
This commit is contained in:
parent
5e6d98e79f
commit
e2330617ac
@ -180,7 +180,7 @@ update_sm_hints (MetaWindow *window)
|
||||
&str))
|
||||
{
|
||||
window->sm_client_id = g_strdup (str);
|
||||
meta_XFree (str);
|
||||
g_free (str);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -204,7 +204,7 @@ update_sm_hints (MetaWindow *window)
|
||||
window->desc);
|
||||
|
||||
window->sm_client_id = g_strdup (str);
|
||||
meta_XFree (str);
|
||||
g_free (str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -993,7 +993,7 @@ meta_prop_get_values (MetaX11Display *x11_display,
|
||||
{
|
||||
char *new_str;
|
||||
new_str = latin1_to_utf8 (values[i].v.str);
|
||||
free (values[i].v.str);
|
||||
g_free (values[i].v.str);
|
||||
values[i].v.str = new_str;
|
||||
}
|
||||
break;
|
||||
@ -1072,7 +1072,7 @@ free_value (MetaPropValue *value)
|
||||
break;
|
||||
case META_PROP_VALUE_UTF8:
|
||||
case META_PROP_VALUE_STRING:
|
||||
free (value->v.str);
|
||||
g_free (value->v.str);
|
||||
break;
|
||||
case META_PROP_VALUE_STRING_AS_UTF8:
|
||||
g_free (value->v.str);
|
||||
|
Loading…
Reference in New Issue
Block a user