]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: postlogin: Don't unreference already closed login-connection
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 17 May 2018 15:35:04 +0000 (18:35 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 8 Jun 2018 08:43:02 +0000 (11:43 +0300)
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)

src/lib-master/master-login.c

index e05cec93ef18d45298fdeab3db0d38123531f0a3..06e0a69deaa0705c8811f785bd123c0f0e61c3fa 100644 (file)
@@ -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,