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.
This commit is contained in:
Marko Mäkelä 2020-03-25 12:09:47 +02:00
parent bc862c4ebe
commit a1846b7a64

View file

@ -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);
}