Commit 4680eee7 authored by marko's avatar marko

branches/5.1: Backport a fix from branches/zip r2763:

row_drop_database_for_mysql(): Postpone mem_free(table_name), so that
an error printout will not dereference freed memory.
parent fe7d8b5a
...@@ -3441,8 +3441,6 @@ loop: ...@@ -3441,8 +3441,6 @@ loop:
err = row_drop_table_for_mysql(table_name, trx, TRUE); err = row_drop_table_for_mysql(table_name, trx, TRUE);
mem_free(table_name);
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
fputs("InnoDB: DROP DATABASE ", stderr); fputs("InnoDB: DROP DATABASE ", stderr);
ut_print_name(stderr, trx, TRUE, name); ut_print_name(stderr, trx, TRUE, name);
...@@ -3450,8 +3448,11 @@ loop: ...@@ -3450,8 +3448,11 @@ loop:
(ulint) err); (ulint) err);
ut_print_name(stderr, trx, TRUE, table_name); ut_print_name(stderr, trx, TRUE, table_name);
putc('\n', stderr); putc('\n', stderr);
mem_free(table_name);
break; break;
} }
mem_free(table_name);
} }
if (err == DB_SUCCESS) { if (err == DB_SUCCESS) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment