[tarantool-patches] Re: [PATCH v1 2/2] sql: fixed possible leak in sqlite3EndTable
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Fri Jul 13 13:26:09 MSK 2018
Thanks for the patch! See 1 comment below.
On 12/07/2018 19:34, Kirill Shcherbatov wrote:
> ---
> src/box/sql/build.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/src/box/sql/build.c b/src/box/sql/build.c
> index 946b10c..200f7e8 100644
> --- a/src/box/sql/build.c
> +++ b/src/box/sql/build.c
> @@ -1795,7 +1795,7 @@ sqlite3EndTable(Parse * pParse, /* Parse context */
> */
> struct ExprList *old_checks = p->def->opts.checks;
> if (sql_table_def_rebuild(db, p) != 0)
> - return;
> + goto cleanup;
> sql_expr_list_delete(db, old_checks);
> }
I see two returns below this line. Why have not you replaced
them with goto cleanup?
>
> @@ -1923,6 +1923,7 @@ sqlite3EndTable(Parse * pParse, /* Parse context */
> * don't require make a copy on space_def_dup and to improve
> * debuggability.
> */
> +cleanup:
> sql_expr_list_delete(db, p->def->opts.checks);
> p->def->opts.checks = NULL;
> }
>
More information about the Tarantool-patches
mailing list