From: Josef 'Jeff' Sipek Date: Tue, 6 Jun 2017 09:30:17 +0000 (+0300) Subject: lib: timeout_remove(NULL) should be a no-op X-Git-Tag: 2.3.0.rc1~985 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c4d38ef68c615df366208e087fdca99f14b5a3cd;p=thirdparty%2Fdovecot%2Fcore.git lib: timeout_remove(NULL) should be a no-op --- diff --git a/src/lib/ioloop.c b/src/lib/ioloop.c index af5f7ac9a8..4e73e5de24 100644 --- a/src/lib/ioloop.c +++ b/src/lib/ioloop.c @@ -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)