Skip to content

Commit

Permalink
fix leak in __wait_set_clean_up (ros2#418)
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
  • Loading branch information
dirk-thomas authored and xabxx committed Apr 25, 2019
1 parent 26744b0 commit f8ced7c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions rcl/src/rcl/wait.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f8ced7c

Please sign in to comment.