summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2015-09-29 08:39:54 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2015-09-29 08:39:54 +0300
commita95711e45d45ec3f024468373087160fc9e4ff6b (patch)
tree010c7366250930a57e7142441b6d343153565a4c /storage
parent02a38fd27e71fb6657a4da294bd8dd2e1c2b216c (diff)
downloadmariadb-git-a95711e45d45ec3f024468373087160fc9e4ff6b.tar.gz
MDEV-8855: innodb.innodb-fk-warnings fails on Windows
Fixed incorrect access to freed memory.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/dict/dict0dict.c4
-rw-r--r--storage/xtradb/dict/dict0dict.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
index 6693c731b6c..ad900385325 100644
--- a/storage/innobase/dict/dict0dict.c
+++ b/storage/innobase/dict/dict0dict.c
@@ -4225,7 +4225,6 @@ col_loop2:
ptr = dict_accept(cs, ptr, ")", &success);
if (!success || foreign->n_fields != i) {
- dict_foreign_free(foreign);
dict_foreign_report_syntax_err(
"%s table %s with foreign key constraint"
@@ -4238,6 +4237,9 @@ col_loop2:
" failed. Foreign key constraint parse error in %s"
" close to %s. Too few referenced columns, you have %d when you should have %d.",
operation, create_name, start_of_latest_foreign, orig, i, foreign->n_fields);
+
+ dict_foreign_free(foreign);
+
return(DB_CANNOT_ADD_CONSTRAINT);
}
diff --git a/storage/xtradb/dict/dict0dict.c b/storage/xtradb/dict/dict0dict.c
index a7d9412ff15..4132bf69b17 100644
--- a/storage/xtradb/dict/dict0dict.c
+++ b/storage/xtradb/dict/dict0dict.c
@@ -4357,7 +4357,6 @@ col_loop2:
ptr = dict_accept(cs, ptr, ")", &success);
if (!success || foreign->n_fields != i) {
- dict_foreign_free(foreign);
dict_foreign_report_syntax_err(
"%s table %s with foreign key constraint"
@@ -4370,6 +4369,9 @@ col_loop2:
" failed. Foreign key constraint parse error in %s"
" close to %s. Too few referenced columns, you have %d when you should have %d.",
operation, create_name, start_of_latest_foreign, orig, i, foreign->n_fields);
+
+ dict_foreign_free(foreign);
+
return(DB_CANNOT_ADD_CONSTRAINT);
}