Skip to content

Commit a95711e

Browse files
author
Jan Lindström
committed
MDEV-8855: innodb.innodb-fk-warnings fails on Windows
Fixed incorrect access to freed memory.
1 parent 02a38fd commit a95711e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

storage/innobase/dict/dict0dict.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4225,7 +4225,6 @@ dict_create_foreign_constraints_low(
42254225
ptr = dict_accept(cs, ptr, ")", &success);
42264226

42274227
if (!success || foreign->n_fields != i) {
4228-
dict_foreign_free(foreign);
42294228

42304229
dict_foreign_report_syntax_err(
42314230
"%s table %s with foreign key constraint"
@@ -4238,6 +4237,9 @@ dict_create_foreign_constraints_low(
42384237
" failed. Foreign key constraint parse error in %s"
42394238
" close to %s. Too few referenced columns, you have %d when you should have %d.",
42404239
operation, create_name, start_of_latest_foreign, orig, i, foreign->n_fields);
4240+
4241+
dict_foreign_free(foreign);
4242+
42414243
return(DB_CANNOT_ADD_CONSTRAINT);
42424244
}
42434245

storage/xtradb/dict/dict0dict.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4357,7 +4357,6 @@ dict_create_foreign_constraints_low(
43574357
ptr = dict_accept(cs, ptr, ")", &success);
43584358

43594359
if (!success || foreign->n_fields != i) {
4360-
dict_foreign_free(foreign);
43614360

43624361
dict_foreign_report_syntax_err(
43634362
"%s table %s with foreign key constraint"
@@ -4370,6 +4369,9 @@ dict_create_foreign_constraints_low(
43704369
" failed. Foreign key constraint parse error in %s"
43714370
" close to %s. Too few referenced columns, you have %d when you should have %d.",
43724371
operation, create_name, start_of_latest_foreign, orig, i, foreign->n_fields);
4372+
4373+
dict_foreign_free(foreign);
4374+
43734375
return(DB_CANNOT_ADD_CONSTRAINT);
43744376
}
43754377

0 commit comments

Comments
 (0)