From 82102f8599e1792b331557b9135404750ee0ada7 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 26 Jun 2019 14:15:09 +1000 Subject: [PATCH] If we never initialized the libwacom database, don't check the refcount If the libwacom context failed to initialize for some reason, the database is NULL and the refcount remains at zero. Calling unref should just work then. Signed-off-by: Peter Hutterer --- src/libinput.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libinput.c b/src/libinput.c index c0cd2fa4..6d00a006 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -4257,6 +4257,9 @@ libinput_libwacom_ref(struct libinput *li) void libinput_libwacom_unref(struct libinput *li) { + if (!li->libwacom.db) + return; + assert(li->libwacom.refcount >= 1); if (--li->libwacom.refcount == 0) {