From: Ruslan Ermilov Date: Sat, 3 Dec 2016 07:01:39 +0000 (+0300) Subject: Slab: improved double free detection. X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=cdd0cd6e2c8a8556477f7b22c32dd472af644d21;p=nginx.git 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 index b2adbf423..0fc63b5c4 100644 --- a/src/core/ngx_slab.c +++ b/src/core/ngx_slab.c @@ -597,7 +597,7 @@ ngx_slab_free_locked(ngx_slab_pool_t *pool, void *p) 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;