From: Timo Sirainen Date: Thu, 17 May 2018 15:35:04 +0000 (+0300) Subject: lib-master: postlogin: Don't unreference already closed login-connection X-Git-Tag: 2.3.2.rc1~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0db446f1363a519b65754c5c277ae4482dec1124;p=thirdparty%2Fdovecot%2Fcore.git lib-master: postlogin: Don't unreference already closed login-connection If the login-connection was already closed, this caused too many unreferences. Fixes: Panic: file master-login.c: line 544 (master_login_conn_unref): assertion failed: (conn->clients == NULL) --- diff --git a/src/lib-master/master-login.c b/src/lib-master/master-login.c index e05cec93ef..06e0a69dea 100644 --- a/src/lib-master/master-login.c +++ b/src/lib-master/master-login.c @@ -444,8 +444,10 @@ master_login_auth_callback(const char *const *auth_args, const char *errormsg, /* we've sent the reply. the connection is no longer needed, so disconnect it (before login process disconnects us and logs an error) */ - master_login_conn_close(conn); - master_login_conn_unref(&conn); + if (!master_login_conn_is_closed(conn)) { + master_login_conn_close(conn); + master_login_conn_unref(&conn); + } /* execute post-login scripts before finishing auth */ if (master_login_postlogin(client, auth_args,