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

This commit is contained in:
Monty 2019-08-20 15:28:01 +03:00
parent 262927a9e5
commit 6dd1d6cb90

View file

@ -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));
if (!range) {
grn_obj_unlink(ctx, column);
DBUG_RETURN(false);
}
if (!mrn::grn::is_table(range)) {
grn_obj_unlink(ctx, column);
DBUG_RETURN(false);
}
@ -9011,6 +9013,7 @@ bool ha_mroonga::is_foreign_key_field(const char *table_name,
DBUG_RETURN(true);
}
grn_obj_unlink(ctx, column);
DBUG_RETURN(false);
}