summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_controller.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-10-25 15:09:07 +0300
committerMax Romanov <max.romanov@nginx.com>2017-10-25 15:09:07 +0300
commit51396fea832e6a0461057f0f990c9d3e9ebb65e9 (patch)
tree975df337a23474b0262f850c0d8af5fcfd935ef1 /src/nxt_controller.c
parent5ed4d7b9dcd11bf2f37130812dbc34d951a73484 (diff)
downloadunit-51396fea832e6a0461057f0f990c9d3e9ebb65e9.tar.gz
unit-51396fea832e6a0461057f0f990c9d3e9ebb65e9.tar.bz2
Checking the result of shared memory buffer allocation.
This closes #57 issue on GitHub.
Diffstat (limited to 'src/nxt_controller.c')
-rw-r--r--src/nxt_controller.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nxt_controller.c b/src/nxt_controller.c
index fd932aa0..78da02a8 100644
--- a/src/nxt_controller.c
+++ b/src/nxt_controller.c
@@ -328,6 +328,9 @@ nxt_controller_conf_send(nxt_task_t *task, nxt_conf_value_t *conf,
size = nxt_conf_json_length(conf, NULL);
b = nxt_port_mmap_get_buf(task, router_port, size);
+ if (nxt_slow_path(b == NULL)) {
+ return NXT_ERROR;
+ }
b->mem.free = nxt_conf_json_print(b->mem.free, conf, NULL);