embedded use-after-free ASAN error

Close MYSQL (and destroy THD) in the same thread where it was used,
because THD embeds MDL_context, that owns some LF_PINS, that remember
a pointer to my_thread_var->stack_ends_here.
This commit is contained in:
Sergei Golubchik 2018-05-23 23:30:14 +02:00
parent bfed1bfe28
commit 9e22cae1cf

View file

@ -903,6 +903,8 @@ pthread_handler_t connection_thread(void *arg)
end_thread:
cn->query_done= 1;
mysql_close(cn->mysql);
cn->mysql= 0;
mysql_thread_end();
pthread_exit(0);
return 0;