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.2.36~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=30f693b48dd980f9d79a63e3a75f84f0130a093a;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 cbf00c9f3d..577dd2c8d4 100644 --- a/src/lib-master/master-login.c +++ b/src/lib-master/master-login.c @@ -448,8 +448,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,