summaryrefslogtreecommitdiff
path: root/client
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-04-01 12:08:45 +0300
commita1846b7a642dd5b5b36f3d4f0099cb7c0149f859 (patch)
tree2ec17f7e5d62a5b571761369605f599343db4e3b /client
parentbc862c4ebeb9d706465d580ed58c235704579c05 (diff)
downloadmariadb-git-a1846b7a642dd5b5b36f3d4f0099cb7c0149f859.tar.gz
MDEV-22035 Memory leak in main.mysqltest
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.
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 1517771e743..46e83bf0292 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -10190,6 +10190,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);
}