From 20fdf1b5b82a6b1dc23cc7bef643bf18dfdcd2c3 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Tue, 16 Apr 2019 19:29:19 -0700 Subject: [PATCH] fix leak in __wait_set_clean_up Signed-off-by: Dirk Thomas --- rcl/src/rcl/wait.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/rcl/src/rcl/wait.c b/rcl/src/rcl/wait.c index 4d817a3d3..20117a135 100644 --- a/rcl/src/rcl/wait.c +++ b/rcl/src/rcl/wait.c @@ -83,11 +83,9 @@ __wait_set_is_valid(const rcl_wait_set_t * wait_set) static void __wait_set_clean_up(rcl_wait_set_t * wait_set, rcl_allocator_t allocator) { - if (wait_set->subscriptions) { - rcl_ret_t ret = rcl_wait_set_resize(wait_set, 0, 0, 0, 0, 0); - (void)ret; // NO LINT - assert(RCL_RET_OK == ret); // Defensive, shouldn't fail with size 0. - } + rcl_ret_t ret = rcl_wait_set_resize(wait_set, 0, 0, 0, 0, 0); + (void)ret; // NO LINT + assert(RCL_RET_OK == ret); // Defensive, shouldn't fail with size 0. if (wait_set->impl) { allocator.deallocate(wait_set->impl, allocator.state); wait_set->impl = NULL;