changeset 22973:a6b0d77f7b15

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)
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 17 May 2018 18:35:04 +0300
parents 9d607779f192
children 9ca23f52eb59
files src/lib-master/master-login.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-master/master-login.c	Fri May 04 15:27:14 2018 +0300
+++ b/src/lib-master/master-login.c	Thu May 17 18:35:04 2018 +0300
@@ -448,8 +448,10 @@
 		/* 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,