summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-05-23 23:30:14 +0200
committerSergei Golubchik <serg@mariadb.org>2018-05-25 18:24:06 +0200
commit9e22cae1cfcb4fce7a6469e9b136d599efe6b87c (patch)
treef07c84eaea8333677ecdd5ed372df4ce5474ed91
parentbfed1bfe28980d3b1404f99a44712242a5108ef5 (diff)
downloadmariadb-git-9e22cae1cfcb4fce7a6469e9b136d599efe6b87c.tar.gz
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.
-rw-r--r--client/mysqltest.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 5ab84323a76..620a3417ac3 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -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;