From: Josef 'Jeff' Sipek Date: Thu, 9 Nov 2017 15:39:25 +0000 (-0500) Subject: ssl-iostream: ssl_iostream_destroy(NULL) should be a no-op X-Git-Tag: 2.3.1~86 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba110cd15ce4f9115d80dc8b2557ff2225cb741b;p=thirdparty%2Fdovecot%2Fcore.git ssl-iostream: ssl_iostream_destroy(NULL) should be a no-op --- diff --git a/src/lib-ssl-iostream/iostream-ssl.c b/src/lib-ssl-iostream/iostream-ssl.c index cab0f8d8c2..da9184c4c4 100644 --- a/src/lib-ssl-iostream/iostream-ssl.c +++ b/src/lib-ssl-iostream/iostream-ssl.c @@ -161,6 +161,10 @@ void ssl_iostream_destroy(struct ssl_iostream **_ssl_io) { struct ssl_iostream *ssl_io = *_ssl_io; + if (_ssl_io == NULL || *_ssl_io == NULL) + return; + + ssl_io = *_ssl_io; *_ssl_io = NULL; ssl_vfuncs->destroy(ssl_io); }