]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Do not crash when closing both client and upstream
authorOndřej Kuzník <ondra@mistotebe.net>
Thu, 13 Jul 2017 16:08:50 +0000 (17:08 +0100)
committerOndřej Kuzník <okuznik@symas.com>
Tue, 17 Nov 2020 17:55:46 +0000 (17:55 +0000)
servers/lloadd/operation.c

index 425cf022653164d641ce415991aec0aebb98c392..01b4dc3c3d51d907318245da0df687e33c3a1696 100644 (file)
@@ -581,6 +581,15 @@ operation_abandon( Operation *op )
 
     CONNECTION_LOCK_DECREF(c);
 unlock:
+    /*
+     * FIXME: the dance in operation_destroy_from_upstream might be slower than
+     * optimal as we've done some of the things above already. However, we want
+     * to clear o_upstream from the op if it's dying, but witnessing and
+     * navigating the race to do that safely is too complex to copy here.
+     */
+    if ( !c->c_live ) {
+        operation_destroy_from_upstream( op );
+    }
     UPSTREAM_UNLOCK_OR_DESTROY(c);
 
 done: