mirror of
https://github.com/brl/mutter.git
synced 2025-01-22 17:38:56 +00:00
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:
parent
83cd36e95f
commit
877e58a6b4
@ -255,7 +255,7 @@ get_device_ids (ClutterBackendX11 *backend_x11,
|
|||||||
gchar **product_id)
|
gchar **product_id)
|
||||||
{
|
{
|
||||||
gulong nitems, bytes_after;
|
gulong nitems, bytes_after;
|
||||||
guint32 *data;
|
guint32 *data = NULL;
|
||||||
int rc, format;
|
int rc, format;
|
||||||
Atom type;
|
Atom type;
|
||||||
|
|
||||||
@ -268,7 +268,10 @@ get_device_ids (ClutterBackendX11 *backend_x11,
|
|||||||
clutter_x11_untrap_x_errors ();
|
clutter_x11_untrap_x_errors ();
|
||||||
|
|
||||||
if (rc != Success || type != XA_INTEGER || format != 32 || nitems != 2)
|
if (rc != Success || type != XA_INTEGER || format != 32 || nitems != 2)
|
||||||
return FALSE;
|
{
|
||||||
|
XFree (data);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (vendor_id)
|
if (vendor_id)
|
||||||
*vendor_id = g_strdup_printf ("%.4x", data[0]);
|
*vendor_id = g_strdup_printf ("%.4x", data[0]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user