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

index af5f7ac9a8db7ec5374a1bd2fc3ebce3f23e5180..4e73e5de243270eb35c27a123431d9f3be238706 100644 (file)
@@ -320,7 +320,12 @@ static void timeout_free(struct timeout *timeout)
 void timeout_remove(struct timeout **_timeout)
 {
        struct timeout *timeout = *_timeout;
-       struct ioloop *ioloop = timeout->ioloop;
+       struct ioloop *ioloop;
+
+       if (timeout == NULL)
+               return;
+
+       ioloop = timeout->ioloop;
 
        *_timeout = NULL;
        if (timeout->item.idx != UINT_MAX)