]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ldap: Fixed assert-crash when killing LDAP connection.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 12 May 2016 21:45:34 +0000 (17:45 -0400)
committerGitLab <gitlab@git.dovecot.net>
Mon, 16 May 2016 18:39:20 +0000 (21:39 +0300)
libldap may have already closed the fd, so with epoll io_remove() would
try to remove it and crash with:

Panic: epoll_ctl(del, 12) failed: Bad file descriptor

src/lib-ldap/ldap-connection.c

index 35dd0d7c76ea42be5386dc4b74036a6753d2f8d4..1322c9341d4c2c9402e09bd46692f60a9b8072ff 100644 (file)
@@ -552,7 +552,7 @@ int ldap_connection_connect(struct ldap_connection *conn)
 void ldap_connection_kill(struct ldap_connection *conn)
 {
        if (conn->io != NULL)
-               io_remove(&(conn->io));
+               io_remove_closed(&(conn->io));
        if (conn->to_disconnect != NULL)
                timeout_remove(&(conn->to_disconnect));
        if (conn->to_reconnect != NULL)