Skip to content

Commit

Permalink
Core: guard against failed allocation during binary upgrade.
Browse files Browse the repository at this point in the history
Patch by Piotr Sikora.


git-svn-id: svn://svn.nginx.org/nginx/trunk@5117 73f98a42-aea0-e011-b76d-00259023448c
  • Loading branch information
ru committed Mar 18, 2013
1 parent aa22b98 commit c2a5220
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/nginx.c
Expand Up @@ -594,6 +594,9 @@ ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv)
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));

Expand Down

0 comments on commit c2a5220

Please sign in to comment.