Skip to content

Commit

Permalink
fix leak in __wait_set_clean_up (#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 nuclearsandwich committed Aug 15, 2019
1 parent 287eed5 commit 3f1f15c
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 @@ -78,11 +78,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 3f1f15c

Please sign in to comment.