]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorBrian Wellington <source@isc.org>
Tue, 16 Jan 2001 23:25:16 +0000 (23:25 +0000)
committerBrian Wellington <source@isc.org>
Tue, 16 Jan 2001 23:25:16 +0000 (23:25 +0000)
race condition [RT #670]

bin/named/client.c

index 305c5016177d88047d4c11f4fcef1dfc89005059..4fb71f69d6deb0b4274538cfd0c4c39f07ddb189 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: client.c,v 1.136.2.1 2001/01/09 22:31:50 bwelling Exp $ */
+/* $Id: client.c,v 1.136.2.2 2001/01/16 23:25:16 bwelling Exp $ */
 
 #include <config.h>
 
@@ -256,8 +256,6 @@ client_free(ns_client_t *client) {
                isc_buffer_free(&client->opt_view);
 #endif /* DNS_OPT_NEWCODES */
        dns_message_destroy(&client->message);
-       if (client->task != NULL)
-               isc_task_detach(&client->task);
        if (client->manager != NULL) {
                manager = client->manager;
                LOCK(&manager->lock);
@@ -270,6 +268,14 @@ client_free(ns_client_t *client) {
                UNLOCK(&manager->lock);
        }
 
+       /*
+        * Detaching the task must be done after unlinking from
+        * the manager's lists because the manager accesses
+        * client->task.
+        */
+       if (client->task != NULL)
+               isc_task_detach(&client->task);
+
        CTRACE("free");
        client->magic = 0;
        isc_mem_put(client->mctx, client, sizeof *client);