diff src/os/unix/ngx_posix_init.c @ 5826:16013b71feed

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 08 Sep 2014 21:36:09 +0400
parents 1209b8a7b077
children cb31017e961b
line wrap: on
line diff
--- 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;