Tarantool development patches archive
 help / color / mirror / Atom feed
From: AKhatskevich <avkhatskevich@tarantool.org>
To: tarantool-patches@freelists.org
Cc: AKhatskevich <avkhatskevich@tarantool.org>
Subject: [tarantool-patches] [PATCH 2/3] sql: fix memory leak
Date: Thu, 29 Mar 2018 13:17:51 +0300	[thread overview]
Message-ID: <ba4dc33897d10f7fc99acff7ca215dd266c3504a.1522318267.git.avkhatskevich@tarantool.org> (raw)
In-Reply-To: <cover.1522318267.git.avkhatskevich@tarantool.org>
In-Reply-To: <cover.1522318267.git.avkhatskevich@tarantool.org>

index_def_new makes its own copy of key_def, so it should be deleted.
---
 src/box/sql.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/box/sql.c b/src/box/sql.c
index 224747157..98bcd93ca 100644
--- a/src/box/sql.c
+++ b/src/box/sql.c
@@ -442,6 +442,7 @@ int tarantoolSqlite3EphemeralCreate(BtCursor *pCur, uint32_t field_count,
 		index_def_new(0 /*space id */, 0 /* index id */, "ephemer_idx",
 			      strlen("ephemer_idx"), TREE, &index_opts_default,
 			      ephemer_key_def, NULL /* pk def */);
+	key_def_delete(ephemer_key_def);
 
 	struct rlist key_list;
 	rlist_create(&key_list);
-- 
2.14.1

  parent reply	other threads:[~2018-03-29 10:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29 10:17 [tarantool-patches] [PATCH 0/3] Ephemeral tables perf leak & next rowid bug AKhatskevich
2018-03-29 10:17 ` [tarantool-patches] [PATCH 1/3] sql: Generate rowid by counter AKhatskevich
2018-03-29 10:17 ` AKhatskevich [this message]
2018-03-29 10:17 ` [tarantool-patches] [PATCH 3/3] sql: report errors in EphemeralGetMaxId AKhatskevich

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=ba4dc33897d10f7fc99acff7ca215dd266c3504a.1522318267.git.avkhatskevich@tarantool.org \
    --to=avkhatskevich@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH 2/3] sql: fix memory leak' \
    /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