mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
Fix bug #77955
Free metadata before freeing the arena. I don't have a repro script, but the added assertion fails for many existing tests prior to this change.
This commit is contained in:
parent
b394654c1e
commit
6f9dfd9473
4
NEWS
4
NEWS
@ -14,6 +14,10 @@ PHP NEWS
|
||||
. Fixed bug #77956 (When mysqli.allow_local_infile = Off, use a meaningful
|
||||
error message). (Sjon Hortensius)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #77955 (Random segmentation fault in mysqlnd from php-fpm).
|
||||
(Nikita)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #78015 (Incorrect evaluation of expressions involving partials
|
||||
arrays in SCCP). (Nikita)
|
||||
|
@ -110,6 +110,17 @@ static zend_always_inline void zend_arena_release(zend_arena **arena_ptr, void *
|
||||
arena->ptr = (char*)checkpoint;
|
||||
}
|
||||
|
||||
static zend_always_inline zend_bool zend_arena_contains(zend_arena *arena, void *ptr)
|
||||
{
|
||||
while (arena) {
|
||||
if ((char*)ptr > (char*)arena && (char*)ptr <= arena->ptr) {
|
||||
return 1;
|
||||
}
|
||||
arena = arena->prev;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* _ZEND_ARENA_H_ */
|
||||
|
||||
/*
|
||||
|
@ -294,13 +294,14 @@ void MYSQLND_METHOD(mysqlnd_res, free_result_contents_internal)(MYSQLND_RES * re
|
||||
{
|
||||
DBG_ENTER("mysqlnd_res::free_result_contents_internal");
|
||||
|
||||
result->m.free_result_buffers(result);
|
||||
|
||||
if (result->meta) {
|
||||
ZEND_ASSERT(zend_arena_contains(result->memory_pool->arena, result->meta));
|
||||
result->meta->m->free_metadata(result->meta);
|
||||
result->meta = NULL;
|
||||
}
|
||||
|
||||
result->m.free_result_buffers(result);
|
||||
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
/* }}} */
|
||||
|
Loading…
Reference in New Issue
Block a user