Fixed off-by-one error in shared zone initialization.

On systems without atomic ops, not enough space was allocated
for mutex's file name during shared zone initialization.
This commit is contained in:
Ruslan Ermilov 2018-10-02 13:32:52 +03:00
parent a50dec6d6a
commit df0dfa634d

View File

@ -921,7 +921,8 @@ ngx_init_zone_pool(ngx_cycle_t *cycle, ngx_shm_zone_t *zn)
#else
file = ngx_pnalloc(cycle->pool, cycle->lock_file.len + zn->shm.name.len);
file = ngx_pnalloc(cycle->pool,
cycle->lock_file.len + zn->shm.name.len + 1);
if (file == NULL) {
return NGX_ERROR;
}