From: Peter Hutterer Date: Wed, 31 Jul 2019 22:28:13 +0000 (+1000) Subject: tools: record: fix segfault on exit X-Git-Tag: 1.14.0~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=803519ae59cc8214a898159a27131d7c96a7a157;p=platform%2Fupstream%2Flibinput.git tools: record: fix segfault on exit If we don't supply --with-libinput, the device is NULL so we can't unref it. Signed-off-by: Peter Hutterer --- diff --git a/tools/libinput-record.c b/tools/libinput-record.c index ff4a12f..2d1400e 100644 --- a/tools/libinput-record.c +++ b/tools/libinput-record.c @@ -2460,7 +2460,8 @@ main(int argc, char **argv) rc = mainloop(&ctx); out: list_for_each_safe(d, tmp, &ctx.devices, link) { - libinput_device_unref(d->device); + if (d->device) + libinput_device_unref(d->device); free(d->events); free(d->devnode); libevdev_free(d->evdev);