[MDEV-31636] Memory leak in Sys_var_gtid_binlog_state::do_check() Created: 2023-07-06 Updated: 2023-11-28 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Replication, Variables |
| Affects Version/s: | 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.11, 11.0, 11.1, 11.2, 10.11.4 |
| Fix Version/s: | 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Alexander Barkov | Assignee: | Andrei Elkin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The leaked memory is allocated in Sys_var_gtid_binlog_state::do_check() in this code:
The problem happens because:
|
| Comments |
| Comment by Alexander Barkov [ 2023-07-06 ] |
|
For the new system variable @@character_set_collations we'll need to allocate a temporary value to pass it between do_check() and session_update()/global_update(), similar to how it is done in @@gtid_binlog_state. So @@gtid_binlog_state should be fixed first. |
| Comment by Alexander Barkov [ 2023-07-06 ] |
|
A possible solution would be to allocate the structure on THD::mem_root instead of using my_malloc. |