From: Peter Hutterer Date: Tue, 24 Dec 2013 01:00:37 +0000 (+1000) Subject: Allow libinput_destroy() on a NULL pointer X-Git-Tag: 0.1.0~98 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e67b6da3986af9d0a4920929c82422cc005b426;p=platform%2Fupstream%2Flibinput.git Allow libinput_destroy() on a NULL pointer Signed-off-by: Peter Hutterer --- diff --git a/src/libinput.c b/src/libinput.c index 550ca94..e30b6a2 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -400,6 +400,9 @@ libinput_destroy(struct libinput *libinput) struct libinput_device *device, *next_device; struct libinput_seat *seat, *next_seat; + if (libinput == NULL) + return; + while ((event = libinput_get_event(libinput))) libinput_event_destroy(event); free(libinput->events);