summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2018-04-27 20:32:50 +0300
committerMax Romanov <max.romanov@nginx.com>2018-04-27 20:32:50 +0300
commit07204789bcaa8223fd38a9cf3f1f76e5655acbdd (patch)
treea6ce91fb6066d0da0889a8b1d7cea5f8a66f3fff /src/nxt_router.c
parent10898568a3294e9af4345997462d8ebc743aa32b (diff)
downloadunit-07204789bcaa8223fd38a9cf3f1f76e5655acbdd.tar.gz
unit-07204789bcaa8223fd38a9cf3f1f76e5655acbdd.tar.bz2
Eliminating possible NULL pointer dereference.
Found by Coverity (CID 276138).
Diffstat (limited to '')
-rw-r--r--src/nxt_router.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index 48ad55cd..099aa339 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -779,7 +779,9 @@ nxt_router_new_port_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
{
nxt_port_new_port_handler(task, msg);
- if (msg->u.new_port->type == NXT_PROCESS_CONTROLLER) {
+ if (msg->u.new_port != NULL
+ && msg->u.new_port->type == NXT_PROCESS_CONTROLLER)
+ {
nxt_router_greet_controller(task, msg->u.new_port);
}