summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2015-11-17 14:59:22 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2015-11-18 07:00:01 +1000
commit6fa5f30129ea770bcc5e50b0785a993a8254a418 (patch)
treee4ac6cefc6777ff40ec2d7f53285e901cf80a12e
parentc53dde1a503ace84f755a2a8d0022fba48ad89c2 (diff)
Unref the libinput context on pre_init failure
A device that fails pre_init has a ref to the libinput context but may not have a pInfo->private. For those devices we never call libinput_unref() and the libinput struct never gets freed. Thus if at least one device didn't pass pre_init, we never cleaned up after ourselves. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--src/xf86libinput.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/xf86libinput.c b/src/xf86libinput.c
index f69943c..a4d9bd5 100644
--- a/src/xf86libinput.c
+++ b/src/xf86libinput.c
@@ -1576,6 +1576,8 @@ fail:
valuator_mask_free(&driver_data->valuators_unaccelerated);
free(path);
free(driver_data);
+ if (libinput)
+ driver_context.libinput = libinput_unref(libinput);
return BadValue;
}