Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org
Cc: korablev@tarantool.org, Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [tarantool-patches] [PATCH v1 1/3] sql: fix sql_check_list_item_init double free
Date: Fri, 31 Aug 2018 18:45:40 +0300	[thread overview]
Message-ID: <736e332ce97169cfded6ab6979404d99ee0404a5.1535730218.git.kshcherbatov@tarantool.org> (raw)
In-Reply-To: <cover.1535730218.git.kshcherbatov@tarantool.org>
In-Reply-To: <cover.1535730218.git.kshcherbatov@tarantool.org>

---
 src/box/sql.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/box/sql.c b/src/box/sql.c
index b158c50..d3f50c5 100644
--- a/src/box/sql.c
+++ b/src/box/sql.c
@@ -1711,10 +1711,9 @@ sql_check_list_item_init(struct ExprList *expr_list, int column,
 	}
 	if (expr_str != NULL) {
 		item->pExpr = sql_expr_compile(db, expr_str, expr_str_len);
-		if (item->pExpr == NULL) {
-			sqlite3DbFree(db, item->zName);
+		/* The item->zName would be released later. */
+		if (item->pExpr == NULL)
 			return -1;
-		}
 	}
 	return 0;
 }
-- 
2.7.4

  reply	other threads:[~2018-08-31 15:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 15:45 [tarantool-patches] [PATCH v1 0/3] sql: dissallow bindings for DDL Kirill Shcherbatov
2018-08-31 15:45 ` Kirill Shcherbatov [this message]
2018-08-31 15:45 ` [tarantool-patches] [PATCH v1 2/3] sql: fix sql_*_compile functions leak on error Kirill Shcherbatov
2018-08-31 15:45 ` [tarantool-patches] [PATCH v1 3/3] sql: dissallow bindings for DDL Kirill Shcherbatov
2018-09-04 11:00   ` [tarantool-patches] " n.pettik
2018-09-06 13:04     ` Kirill Shcherbatov
2018-09-10 21:52       ` n.pettik
2018-09-11  7:21         ` Kirill Shcherbatov
2018-09-11 23:03           ` n.pettik
2018-09-13  6:13             ` Kirill Shcherbatov
2018-09-13 10:12 ` [tarantool-patches] Re: [PATCH v1 0/3] " Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=736e332ce97169cfded6ab6979404d99ee0404a5.1535730218.git.kshcherbatov@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH v1 1/3] sql: fix sql_check_list_item_init double free' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox