aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_posix_init.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2014-09-08 21:36:09 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2014-09-08 21:36:09 +0400
commitcb8a0327ab689867f6ea9e05fcb3242883e83bc2 (patch)
tree0254ef9683b5ba36a44d10f6a9769db7362f6f6f /src/os/unix/ngx_posix_init.c
parent90df702bf86e4d9a9a2f319743598bc7aa1f8f57 (diff)
downloadnginx-cb8a0327ab689867f6ea9e05fcb3242883e83bc2.tar.gz
nginx-cb8a0327ab689867f6ea9e05fcb3242883e83bc2.zip
Added ngx_init_setproctitle() return code check.
The ngx_init_setproctitle() function, as used on systems without setproctitle(3), may fail due to memory allocation errors, and therefore its return code needs to be checked. Reported by Markus Linnala.
Diffstat (limited to 'src/os/unix/ngx_posix_init.c')
-rw-r--r--src/os/unix/ngx_posix_init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/os/unix/ngx_posix_init.c b/src/os/unix/ngx_posix_init.c
index 9a4de022d..bf3a310aa 100644
--- a/src/os/unix/ngx_posix_init.c
+++ b/src/os/unix/ngx_posix_init.c
@@ -40,7 +40,9 @@ ngx_os_init(ngx_log_t *log)
}
#endif
- ngx_init_setproctitle(log);
+ if (ngx_init_setproctitle(log) != NGX_OK) {
+ return NGX_ERROR;
+ }
ngx_pagesize = getpagesize();
ngx_cacheline_size = NGX_CPU_CACHE_LINE;