Skip to content

Commit

Permalink
lib: io_remove(NULL) and io_remove_closed(NULL) should be no-ops
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef 'Jeff' Sipek committed Sep 20, 2017
1 parent 7b03234 commit df1c1ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/ioloop.c
Expand Up @@ -167,11 +167,17 @@ static void io_remove_full(struct io **_io, bool closed)

void io_remove(struct io **io)
{
if (*io == NULL)
return;

io_remove_full(io, FALSE);
}

void io_remove_closed(struct io **io)
{
if (*io == NULL)
return;

i_assert(((*io)->condition & IO_NOTIFY) == 0);

io_remove_full(io, TRUE);
Expand Down

0 comments on commit df1c1ff

Please sign in to comment.