changeset 6809:87d7e640b45d

Slab: improved double free detection. Previously, an attempt to double free the starting page of the free range was not detected.
author Ruslan Ermilov <ru@nginx.com>
date Sat, 03 Dec 2016 10:01:39 +0300
parents 2af776c22aec
children 64f5bfba5d96
files src/core/ngx_slab.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;