Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Yukhin <kyukhin@tarantool.org>
To: Roman Khabibov <roman.habibov@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] sql: fix memleak during parsing
Date: Fri, 25 Sep 2020 09:28:22 +0300	[thread overview]
Message-ID: <20200925062822.4vnznrm24fcuby5w@tarantool.org> (raw)
In-Reply-To: <20200923142647.77892-1-roman.habibov@tarantool.org>

Hello,

On 23 сен 17:26, Roman Khabibov wrote:
> Fix a memory leak generated by allocation of indexes array of
> parser ephemeral space.
> ---
> 
> Branch: https://github.com/tarantool/tarantool/tree/romanhabibov/sql-memleak
> 
> P.S. It's really memleak, I checked with valgrind.
> 
>  src/box/sql/tokenize.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/box/sql/tokenize.c b/src/box/sql/tokenize.c
> index 5404a78e9..6cf92b4f7 100644
> --- a/src/box/sql/tokenize.c
> +++ b/src/box/sql/tokenize.c
> @@ -447,6 +447,8 @@ parser_space_delete(struct sql *db, struct space *space)
>  	assert(space->def->opts.is_ephemeral);
>  	for (uint32_t i = 0; i < space->index_count; ++i)
>  		index_def_delete(space->index[i]->def);
> +	if (space->index_count != 0)
> +		free(space->index);

What if there're more than 1 index?

--
Regards, Kirill Yukhin

      parent reply	other threads:[~2020-09-25  6:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23 14:26 Roman Khabibov
2020-09-24 13:12 ` Nikita Pettik
2020-09-24 13:45   ` Roman Khabibov
2020-09-24 21:30 ` Vladislav Shpilevoy
2020-09-25  6:28 ` Kirill Yukhin [this message]

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=20200925062822.4vnznrm24fcuby5w@tarantool.org \
    --to=kyukhin@tarantool.org \
    --cc=roman.habibov@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] sql: fix memleak during parsing' \
    /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