summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqlnd/mysqlnd_debug.c')
-rw-r--r--ext/mysqlnd/mysqlnd_debug.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c
index 8aa307e58f..5d4e06b0b1 100644
--- a/ext/mysqlnd/mysqlnd_debug.c
+++ b/ext/mysqlnd/mysqlnd_debug.c
@@ -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;