]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9991 send_ldap_ber: make sure we're only closing our own connection
authorHoward Chu <hyc@openldap.org>
Mon, 30 Jan 2023 13:23:13 +0000 (13:23 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 30 Jan 2023 19:03:27 +0000 (19:03 +0000)
servers/slapd/result.c

index a50f66498eec9944d7a903dcd892ba6c9964b4ef..1e21cdefba62c0b1c5754a5ab1c3c9a1b76a449e 100644 (file)
@@ -398,7 +398,9 @@ fail:
                        conn->c_writing = 0;
                        ldap_pvt_thread_mutex_unlock( &conn->c_write1_mutex );
                        ldap_pvt_thread_mutex_lock( &conn->c_mutex );
-                       connection_closing( conn, close_reason );
+                       /* conn may have been reused by the time we get the mutex */
+                       if ( op->o_connid == conn->c_connid )
+                               connection_closing( conn, close_reason );
                        ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
                        return -1;
                }