mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
MDEV-24084 Fix race between disconnect and KILL CONNECTION
Prior to this patch, it is possible to access freed memory (THD::event_scheduler) from tp_post_kill_notification(). With this patch, memory is freed only when THD is no more accessible from other threads, i.e after it is removed from the thread_list.
This commit is contained in:
parent
75e7132fca
commit
08b0b70daa
1 changed files with 1 additions and 2 deletions
|
@ -202,12 +202,11 @@ void tp_callback(TP_connection *c)
|
|||
|
||||
error:
|
||||
c->thd= 0;
|
||||
delete c;
|
||||
|
||||
if (thd)
|
||||
{
|
||||
threadpool_remove_connection(thd);
|
||||
}
|
||||
delete c;
|
||||
worker_context.restore();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue