]> 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)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Fri, 18 May 2018 14:08:08 +0000 (17:08 +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 cbf00c9f3da88f22d534386fc38888c767553638..577dd2c8d41f5c2b4aa9fb8b0d63e24bae79e216 100644 (file)
@@ -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,