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 <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-08-01 08:28:13 +10:00
parent 5b20d7f482
commit 803519ae59

View file

@ -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);