diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-24 13:12:11 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-24 14:54:46 +0100 |
commit | 555567468a06c31c7d962c827edc8c2a7f5fc455 (patch) | |
tree | b7aadc833bbc638724decaf784da0c393238a79d /ext/mysqlnd/mysqlnd_debug.c | |
parent | 1ea5d2e5ada7145e5ec36cba5cedda29ce13b076 (diff) | |
download | php-git-555567468a06c31c7d962c827edc8c2a7f5fc455.tar.gz |
Fix memory leaks in mysqlnd debug functionality
Diffstat (limited to 'ext/mysqlnd/mysqlnd_debug.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_debug.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c index b76fd4a2e5..cb512e1e9e 100644 --- a/ext/mysqlnd/mysqlnd_debug.c +++ b/ext/mysqlnd/mysqlnd_debug.c @@ -699,6 +699,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[]) @@ -710,7 +714,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; |