From: Josef 'Jeff' Sipek Date: Tue, 19 Sep 2017 10:21:07 +0000 (+0300) Subject: lib: pool_unref(NULL) shoud be a no-op X-Git-Tag: 2.3.0.rc1~979 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77eae37a92168171293471dd5eeaab037de54f4a;p=thirdparty%2Fdovecot%2Fcore.git lib: pool_unref(NULL) shoud be a no-op --- diff --git a/src/lib/mempool.h b/src/lib/mempool.h index fefac79ebe..8814707de1 100644 --- a/src/lib/mempool.h +++ b/src/lib/mempool.h @@ -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(): */