]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: pool_unref(NULL) shoud be a no-op
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Tue, 19 Sep 2017 10:21:07 +0000 (13:21 +0300)
committerJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Wed, 20 Sep 2017 09:29:06 +0000 (12:29 +0300)
src/lib/mempool.h

index fefac79ebe750622a395212d1aa430e538af34bc..8814707de1970024175e3172a9e9bb64e49cd8a0 100644 (file)
@@ -133,7 +133,8 @@ static inline void pool_ref(pool_t pool)
 
 static inline void pool_unref(pool_t *pool)
 {
-       (*pool)->v->unref(pool);
+       if (*pool != NULL)
+               (*pool)->v->unref(pool);
 }
 
 /* These functions are only for pools created with pool_alloconly_create(): */