# HG changeset patch # User Ruslan Ermilov # Date 1480748499 -10800 # Node ID 87d7e640b45dc03e47d405dbf872b6f1f4ea7782 # Parent 2af776c22aec42b8d16714ab3d008225362dd5c0 Slab: improved double free detection. Previously, an attempt to double free the starting page of the free range was not detected. diff --git a/src/core/ngx_slab.c b/src/core/ngx_slab.c --- a/src/core/ngx_slab.c +++ b/src/core/ngx_slab.c @@ -597,7 +597,7 @@ ngx_slab_free_locked(ngx_slab_pool_t *po goto wrong_chunk; } - if (slab == NGX_SLAB_PAGE_FREE) { + if (!(slab & NGX_SLAB_PAGE_START)) { ngx_slab_error(pool, NGX_LOG_ALERT, "ngx_slab_free(): page is already free"); goto fail;