]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: io_remove(NULL) and io_remove_closed(NULL) should be no-ops
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Tue, 6 Jun 2017 09:19:22 +0000 (12:19 +0300)
committerJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Wed, 20 Sep 2017 09:29:06 +0000 (12:29 +0300)
src/lib/ioloop.c

index f6bd7ab8454a00790d846c24ad244855668f507d..af5f7ac9a8db7ec5374a1bd2fc3ebce3f23e5180 100644 (file)
@@ -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);