Commit bda8d67f authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

race condition [RT #670]

parent 93f40401
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: client.c,v 1.138 2001/01/09 21:39:41 bwelling Exp $ */
/* $Id: client.c,v 1.139 2001/01/16 23:02:58 gson 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);
......@@ -269,6 +267,13 @@ client_free(ns_client_t *client) {
need_clientmgr_destroy = ISC_TRUE;
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment