summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/nxt_application.c4
-rw-r--r--src/nxt_controller.c4
-rw-r--r--src/nxt_router.c2
3 files changed, 9 insertions, 1 deletions
diff --git a/src/nxt_application.c b/src/nxt_application.c
index 061bc220..2a03b8f5 100644
--- a/src/nxt_application.c
+++ b/src/nxt_application.c
@@ -73,6 +73,10 @@ nxt_discovery_start(nxt_task_t *task, void *data)
nxt_discovery_quit,
main_port->pid, NULL);
+ if (nxt_slow_path(stream == 0)) {
+ return NXT_ERROR;
+ }
+
ret = nxt_port_socket_write(task, main_port, NXT_PORT_MSG_MODULES, -1,
stream, discovery_port->id, b);
diff --git a/src/nxt_controller.c b/src/nxt_controller.c
index 0fca81b6..0b863f0c 100644
--- a/src/nxt_controller.c
+++ b/src/nxt_controller.c
@@ -335,6 +335,10 @@ nxt_controller_conf_send(nxt_task_t *task, nxt_conf_value_t *conf,
handler, handler,
router_port->pid, data);
+ if (nxt_slow_path(stream == 0)) {
+ return NXT_ERROR;
+ }
+
rc = nxt_port_socket_write(task, router_port, NXT_PORT_MSG_DATA_LAST, -1,
stream, controller_port->id, b);
diff --git a/src/nxt_router.c b/src/nxt_router.c
index 692d3a48..b70fbc7d 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -1741,7 +1741,7 @@ nxt_router_listen_socket_rpc_create(nxt_task_t *task,
nxt_router_listen_socket_ready,
nxt_router_listen_socket_error,
main_port->pid, rpc);
- if (stream == 0) {
+ if (nxt_slow_path(stream == 0)) {
goto fail;
}