From 6fa5f30129ea770bcc5e50b0785a993a8254a418 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 17 Nov 2015 14:59:22 +1000 Subject: 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 Reviewed-by: Hans de Goede --- src/xf86libinput.c | 2 ++ 1 file changed, 2 insertions(+) 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; } -- cgit v1.2.3