From 5e24b35ecb531e645d367f547873b1feb352c6b6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 21 Oct 2020 10:23:59 +1000 Subject: [PATCH] tools: use a cleanup func for the event in the demo client Signed-off-by: Peter Hutterer --- tools/ei-demo-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ei-demo-client.c b/tools/ei-demo-client.c index 9b8d868..f03535b 100644 --- a/tools/ei-demo-client.c +++ b/tools/ei-demo-client.c @@ -47,6 +47,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(struct ei *, ei_unref); DEFINE_TRIVIAL_CLEANUP_FUNC(struct ei_device *, ei_device_unref); DEFINE_TRIVIAL_CLEANUP_FUNC(struct ei_keymap *, ei_keymap_unref); +DEFINE_TRIVIAL_CLEANUP_FUNC(struct ei_event *, ei_event_unref); static inline void _printf_(1, 2) @@ -259,7 +260,7 @@ int main(int argc, char **argv) ei_dispatch(ei); while (!stop) { - struct ei_event *e = ei_get_event(ei); + _cleanup_(ei_event_unrefp) struct ei_event *e = ei_get_event(ei); if (!e) break; @@ -323,7 +324,6 @@ int main(int argc, char **argv) default: abort(); } - ei_event_unref(e); } if (have_ptr) {