diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index 27a6b868507f..67019379bc86 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -604,72 +604,6 @@ fun:lf_hash_search } -{ - missing shutdown_performance_schema 8 - Memcheck:Leak - fun:malloc - fun:my_malloc - fun:_Z22add_pfs_instr_to_arrayPKcS0_ - fun:mysqld_get_one_option - fun:my_handle_options - fun:handle_options - fun:_Z20handle_early_optionsv -} - -{ - missing shutdown_performance_schema 9 - Memcheck:Leak - fun:malloc - fun:my_malloc - fun:init_dynamic_array2 - fun:_Z25init_pfs_instrument_arrayv - fun:_Z11mysqld_mainiPPc - fun:main -} - -{ - missing shutdown_performance_schema 9a - Memcheck:Leak - fun:malloc - fun:my_malloc - fun:_Z22add_pfs_instr_to_arrayPKcS0_ - fun:mysqld_get_one_option - fun:my_handle_options - fun:_Z20handle_early_optionsv - fun:_Z11mysqld_mainiPPc -} - -# Same as shutdown_performance_schema 9, -# but the compiler/linker can sometime change the -# calls from: -# main() -# --> init_pfs_instrument_array() -# --> init_dynamic_array2() -# to: -# main() -# --> init_dynamic_array2() -# when building with optimizations. - -{ - missing shutdown_performance_schema 10 - Memcheck:Leak - fun:malloc - fun:my_malloc - fun:init_dynamic_array2 - fun:_Z11mysqld_mainiPPc - fun:main -} - -{ - missing shutdown_performance_schema 11 - Memcheck:Leak - fun:malloc - fun:my_malloc - fun:init_dynamic_array2 - fun:_Z11mysqld_mainiPPc - fun:(below main) -} - { Bug 59874 Valgrind warning in InnoDB compression code Memcheck:Cond diff --git a/storage/perfschema/pfs_server.cc b/storage/perfschema/pfs_server.cc index cc5e52f379d4..ecaf9c7b084e 100644 --- a/storage/perfschema/pfs_server.cc +++ b/storage/perfschema/pfs_server.cc @@ -229,7 +229,15 @@ void cleanup_instrument_config() /* Ignore if another thread has already deallocated the array */ if (my_atomic_cas32(&pfs_instr_config_state, &desired_state, PFS_INSTR_CONFIG_DEALLOCATED)) + { + for (uint i= 0; i < pfs_instr_config_array.elements; i++) + { + PFS_instr_config* e; + get_dynamic(&pfs_instr_config_array, &e, i); + my_free(e); + } delete_dynamic(&pfs_instr_config_array); + } } /**