summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-07-07 16:01:34 +0300
committerMax Romanov <max.romanov@nginx.com>2017-07-07 16:01:34 +0300
commit264ae98d49c15e068e5ace88578856bbeb901b82 (patch)
treed0d7ae52c7e6b6f92b5efd49b34a0f5f7b94ef52 /src/nxt_router.c
parentf319220a6c4515f3d31e546b4f1f5de0b94aceb7 (diff)
downloadunit-264ae98d49c15e068e5ace88578856bbeb901b82.tar.gz
unit-264ae98d49c15e068e5ace88578856bbeb901b82.tar.bz2
Using engine's task instead of listen's task.
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r--src/nxt_router.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index 8971fb5b..44dbf200 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -1033,6 +1033,10 @@ nxt_router_listen_socket_close(nxt_task_t *task, void *obj, void *data)
joint = listen->socket.data;
nxt_queue_remove(&listen->link);
+
+ /* 'task' refers to listen->task and we cannot use after nxt_free() */
+ task = &task->thread->engine->task;
+
nxt_free(listen);
nxt_router_listen_socket_release(task, joint);