summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_block_alloc.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-09-12 13:17:27 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-09-13 14:37:03 +0200
commitdf982da5874856e3a4d6bbbefb8d3be97261a6cf (patch)
tree1320cc2c62ae7ca0454261e40fc0b7e1a7f40aba /ext/mysqlnd/mysqlnd_block_alloc.c
parent31f617d9bcc4edc37e7bf9e866447af8df469a79 (diff)
downloadphp-git-df982da5874856e3a4d6bbbefb8d3be97261a6cf.tar.gz
Fix bug #78525
When calling free_result_buffers(), also free field metadata and restore the mempool state to what it was before any allocations have been made. Remove the mempool save/restore logic for the inner result set as this is now handled on a higher level.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_block_alloc.c')
-rw-r--r--ext/mysqlnd/mysqlnd_block_alloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/mysqlnd/mysqlnd_block_alloc.c b/ext/mysqlnd/mysqlnd_block_alloc.c
index 10f6bd3b6d..cba7530c8d 100644
--- a/ext/mysqlnd/mysqlnd_block_alloc.c
+++ b/ext/mysqlnd/mysqlnd_block_alloc.c
@@ -200,6 +200,9 @@ PHPAPI void
mysqlnd_mempool_restore_state(MYSQLND_MEMORY_POOL * pool)
{
DBG_ENTER("mysqlnd_mempool_restore_state");
+#if ZEND_DEBUG
+ ZEND_ASSERT(pool->checkpoint);
+#endif
if (pool->checkpoint) {
mysqlnd_arena_release(&pool->arena, pool->checkpoint);
pool->last = NULL;