Slab: improved double free detection.

Previously, an attempt to double free the starting page of the
free range was not detected.
This commit is contained in:
Ruslan Ermilov 2016-12-03 10:01:39 +03:00
parent 34b41a70a6
commit cdd0cd6e2c

View File

@ -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;