diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-05-28 12:40:54 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-05-28 12:40:54 +0300 |
commit | de368f033dd2d22312269010f20f7f6388ecd95f (patch) | |
tree | 5054dec71c351496b0cc9caa97855b2b48deafe4 | |
parent | 89b1e88f8f0b1d66a19ac9657c9568ef5fb0ff27 (diff) | |
download | unit-de368f033dd2d22312269010f20f7f6388ecd95f.tar.gz unit-de368f033dd2d22312269010f20f7f6388ecd95f.tar.bz2 |
Added NULL check for engine->port.
This is required to handle REMOVE_PID messages if router engine
initialization is incomplete.
-rw-r--r-- | src/nxt_router.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c index 4093db8d..b4cba08b 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -944,8 +944,10 @@ nxt_router_remove_pid_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) nxt_queue_each(engine, &nxt_router->engines, nxt_event_engine_t, link0) { - nxt_port_post(task, engine->port, nxt_router_app_process_remove_pid, - msg->u.data); + if (nxt_fast_path(engine->port != NULL)) { + nxt_port_post(task, engine->port, nxt_router_app_process_remove_pid, + msg->u.data); + } } nxt_queue_loop; |