From 273797e387f083929a5d1abeb6b3d509ffe62f99 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Wed, 17 Apr 2019 10:13:09 -0700 Subject: [PATCH] fix leak in __wait_set_clean_up (#418) 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;