From: Josef 'Jeff' Sipek Date: Thu, 9 Nov 2017 15:36:02 +0000 (-0500) Subject: lib: iostream_proxy_unref(NULL) should be a no-op X-Git-Tag: 2.3.9~2393 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba4cff31455b6dcb89c5d12cd4479b4da55c8596;p=thirdparty%2Fdovecot%2Fcore.git lib: iostream_proxy_unref(NULL) should be a no-op --- diff --git a/src/lib/iostream-proxy.c b/src/lib/iostream-proxy.c index 2b51b741cb..2663420901 100644 --- a/src/lib/iostream-proxy.c +++ b/src/lib/iostream-proxy.c @@ -128,8 +128,12 @@ void iostream_proxy_ref(struct iostream_proxy *proxy) void iostream_proxy_unref(struct iostream_proxy **proxy_r) { - i_assert(proxy_r != NULL && *proxy_r != NULL); - struct iostream_proxy *proxy = *proxy_r; + struct iostream_proxy *proxy; + + if (proxy_r == NULL || *proxy_r == NULL) + return; + + proxy = *proxy_r; *proxy_r = NULL; i_assert(proxy->ref > 0);