Commit 6dd1d6cb authored by Monty's avatar Monty

MDEV-20379 Mroonga has memory leak in ha_mroonga::is_foreign_key_field

parent 262927a9
...@@ -8994,10 +8994,12 @@ bool ha_mroonga::is_foreign_key_field(const char *table_name, ...@@ -8994,10 +8994,12 @@ bool ha_mroonga::is_foreign_key_field(const char *table_name,
grn_obj *range = grn_ctx_at(ctx, grn_obj_get_range(ctx, column)); grn_obj *range = grn_ctx_at(ctx, grn_obj_get_range(ctx, column));
if (!range) { if (!range) {
grn_obj_unlink(ctx, column);
DBUG_RETURN(false); DBUG_RETURN(false);
} }
if (!mrn::grn::is_table(range)) { if (!mrn::grn::is_table(range)) {
grn_obj_unlink(ctx, column);
DBUG_RETURN(false); DBUG_RETURN(false);
} }
...@@ -9011,6 +9013,7 @@ bool ha_mroonga::is_foreign_key_field(const char *table_name, ...@@ -9011,6 +9013,7 @@ bool ha_mroonga::is_foreign_key_field(const char *table_name,
DBUG_RETURN(true); DBUG_RETURN(true);
} }
grn_obj_unlink(ctx, column);
DBUG_RETURN(false); DBUG_RETURN(false);
} }
......
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