Skip to content

Commit

Permalink
fix leak in __wait_set_clean_up
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 committed Apr 17, 2019
1 parent 26744b0 commit ad145ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rcl/src/rcl/wait.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ __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) {
if (
wait_set->subscriptions || wait_set->guard_conditions ||
wait_set->timers || wait_set->clients || wait_set->services)
{
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.
Expand Down

0 comments on commit ad145ca

Please sign in to comment.