From 877e58a6b4ecc6e634891d31c877fb2baf447a18 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 9 Apr 2015 12:35:23 +0100 Subject: [PATCH] x11: Plug a leak on error path If XIGetProperty() does not return what we expect, but still returned something, we need to free it. --- clutter/x11/clutter-device-manager-xi2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clutter/x11/clutter-device-manager-xi2.c b/clutter/x11/clutter-device-manager-xi2.c index 1bad9d710..17c491ef0 100644 --- a/clutter/x11/clutter-device-manager-xi2.c +++ b/clutter/x11/clutter-device-manager-xi2.c @@ -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) - return FALSE; + { + XFree (data); + return FALSE; + } if (vendor_id) *vendor_id = g_strdup_printf ("%.4x", data[0]);