Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #79011
  Fix memory leaks in mysqlnd debug functionality
This commit is contained in:
Nikita Popov 2020-01-24 14:55:00 +01:00
commit dc6ede092f
2 changed files with 12 additions and 2 deletions

View file

@ -697,6 +697,10 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_debug)
MYSQLND_CLASS_METHODS_END;
static void free_ptr(zval *zv) {
efree(Z_PTR_P(zv));
}
/* {{{ mysqlnd_debug_init */
PHPAPI MYSQLND_DEBUG *
mysqlnd_debug_init(const char * skip_functions[])
@ -708,7 +712,7 @@ mysqlnd_debug_init(const char * skip_functions[])
zend_stack_init(&ret->call_stack, sizeof(char *));
zend_stack_init(&ret->call_time_stack, sizeof(uint64_t));
zend_hash_init(&ret->not_filtered_functions, 0, NULL, NULL, 0);
zend_hash_init(&ret->function_profiles, 0, NULL, NULL, 0);
zend_hash_init(&ret->function_profiles, 0, NULL, free_ptr, 0);
ret->m = & mysqlnd_mysqlnd_debug_methods;
ret->skip_functions = skip_functions;