# HG changeset patch # User Ruslan Ermilov # Date 1363590837 0 # Node ID 4d7027deb1bba25a7b289c130e582dd8e8739fd2 # Parent a29c574d61facb8e00168e3675a5f6fc36cf5a43 Core: guard against failed allocation during binary upgrade. Patch by Piotr Sikora. diff --git a/src/core/nginx.c b/src/core/nginx.c --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -594,6 +594,9 @@ ngx_exec_new_binary(ngx_cycle_t *cycle, var = ngx_alloc(sizeof(NGINX_VAR) + cycle->listening.nelts * (NGX_INT32_LEN + 1) + 2, cycle->log); + if (var == NULL) { + return NGX_INVALID_PID; + } p = ngx_cpymem(var, NGINX_VAR "=", sizeof(NGINX_VAR));