From 20014431007a08d25c1df595fbb33d92b1bb719d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 27 Mar 2014 08:43:04 +1000 Subject: [PATCH] test: plug a couple of memory leaks Signed-off-by: Peter Hutterer --- test/log.c | 10 ++++++++++ test/touch.c | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/test/log.c b/test/log.c index bdd99df0..0c5508f7 100644 --- a/test/log.c +++ b/test/log.c @@ -84,6 +84,8 @@ START_TEST(log_handler_invoked) ck_assert_int_gt(log_handler_called, 0); log_handler_called = 0; + + libinput_destroy(li); } END_TEST @@ -100,6 +102,8 @@ START_TEST(log_userdata_NULL) ck_assert_int_gt(log_handler_called, 0); log_handler_called = 0; + + libinput_destroy(li); } END_TEST @@ -116,6 +120,8 @@ START_TEST(log_userdata) ck_assert_int_gt(log_handler_called, 0); log_handler_called = 0; + + libinput_destroy(li); } END_TEST @@ -133,6 +139,8 @@ START_TEST(log_handler_NULL) ck_assert_int_eq(log_handler_called, 0); log_handler_called = 0; libinput_log_set_handler(simple_log_handler, NULL); + + libinput_destroy(li); } END_TEST @@ -154,6 +162,8 @@ START_TEST(log_priority) ck_assert_int_gt(log_handler_called, 0); log_handler_called = 0; + + libinput_destroy(li); } END_TEST diff --git a/test/touch.c b/test/touch.c index 6833e10e..1a9d5ad0 100644 --- a/test/touch.c +++ b/test/touch.c @@ -76,8 +76,10 @@ START_TEST(touch_abs_transform) libinput_dispatch(libinput); while ((ev = libinput_get_event(libinput))) { - if (libinput_event_get_type(ev) != LIBINPUT_EVENT_TOUCH_DOWN) + if (libinput_event_get_type(ev) != LIBINPUT_EVENT_TOUCH_DOWN) { + libinput_event_destroy(ev); continue; + } tev = libinput_event_get_touch_event(ev); fx = libinput_event_touch_get_x_transformed(tev, 1920); @@ -86,6 +88,8 @@ START_TEST(touch_abs_transform) ck_assert_int_eq(li_fixed_to_int(fy), 719); tested = true; + + libinput_event_destroy(ev); } ck_assert(tested);