x11: Plug a leak on error path

If XIGetProperty() does not return what we expect, but still returned
something, we need to free it.
This commit is contained in:
Emmanuele Bassi 2015-04-09 12:35:23 +01:00
parent 83cd36e95f
commit 877e58a6b4

View File

@ -255,7 +255,7 @@ get_device_ids (ClutterBackendX11 *backend_x11,
gchar **product_id)
{
gulong nitems, bytes_after;
guint32 *data;
guint32 *data = NULL;
int rc, format;
Atom type;
@ -268,7 +268,10 @@ get_device_ids (ClutterBackendX11 *backend_x11,
clutter_x11_untrap_x_errors ();
if (rc != Success || type != XA_INTEGER || format != 32 || nitems != 2)
{
XFree (data);
return FALSE;
}
if (vendor_id)
*vendor_id = g_strdup_printf ("%.4x", data[0]);