summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-03-25 12:09:47 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-03-25 12:09:47 +0200
commitf01e7a4741bdf6da419c8a9a0676978b35cb02b4 (patch)
tree02c3aa4b2f219991f83faa12ae80c083e7fe1018
parent9a7d284e202d8862a7b34aaf2253d4627177a90e (diff)
downloadmariadb-git-f01e7a4741bdf6da419c8a9a0676978b35cb02b4.tar.gz
MDEV-22035 Memory leak in main.mysqltestmariadb-10.5.2
The test main.mysqltest could crash or hang with cmake -DWITH_ASAN=ON builds. The reason appears to be a memory leak, which was found out by manually invoking echo --replace_regex a > file ASAN_OPTIONS=log_path=/dev/shm/asan mysqltest ... < file and then examining the /dev/shm/asan.* file.
-rw-r--r--client/mysqltest.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 3c878d4cb97..254020ba124 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -10265,6 +10265,7 @@ void append_replace_regex(char* expr, char *expr_end, struct st_replace_regex* r
return;
err:
+ my_free(res->regex_arr.buffer);
my_free(res);
die("Error parsing replace_regex \"%s\"", expr);
}