aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_cycle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ngx_cycle.c')
-rw-r--r--src/core/ngx_cycle.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index 2da0bf91a..e5468ae9b 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -1285,14 +1285,6 @@ ngx_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name, size_t size, void *tag)
continue;
}
- if (size && size != shm_zone[i].shm.size) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the size %uz of shared memory zone \"%V\" "
- "conflicts with already declared size %uz",
- size, &shm_zone[i].shm.name, shm_zone[i].shm.size);
- return NULL;
- }
-
if (tag != shm_zone[i].tag) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"the shared memory zone \"%V\" is "
@@ -1301,6 +1293,14 @@ ngx_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name, size_t size, void *tag)
return NULL;
}
+ if (size && size != shm_zone[i].shm.size) {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "the size %uz of shared memory zone \"%V\" "
+ "conflicts with already declared size %uz",
+ size, &shm_zone[i].shm.name, shm_zone[i].shm.size);
+ return NULL;
+ }
+
return &shm_zone[i];
}