comparison src/os/win32/ngx_shmem.c @ 4570:b3d4e9c66e24

Win32: fixed memory allocation for shmem name (ticket #134).
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 02 Apr 2012 21:30:58 +0000
parents d620f497c50f
children af7eba90645d
comparison
equal deleted inserted replaced
4569:1db899642518 4570:b3d4e9c66e24
13 ngx_shm_alloc(ngx_shm_t *shm) 13 ngx_shm_alloc(ngx_shm_t *shm)
14 { 14 {
15 u_char *name; 15 u_char *name;
16 uint64_t size; 16 uint64_t size;
17 17
18 name = ngx_alloc(shm->name.len + 2 + sizeof(NGX_INT32_LEN), shm->log); 18 name = ngx_alloc(shm->name.len + 2 + NGX_INT32_LEN, shm->log);
19 if (name == NULL) { 19 if (name == NULL) {
20 return NGX_ERROR; 20 return NGX_ERROR;
21 } 21 }
22 22
23 (void) ngx_sprintf(name, "%V_%s%Z", &shm->name, ngx_unique); 23 (void) ngx_sprintf(name, "%V_%s%Z", &shm->name, ngx_unique);