Added missing checks if nxt_port_rpc_register_handler() failed.

This closes #97 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
This commit is contained in:
Valentin Bartenev
2018-04-17 21:13:43 +03:00
parent 7f79f2f105
commit ab4f867996
3 changed files with 9 additions and 1 deletions

View File

@@ -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;
}