Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: kostja@tarantool.org
Cc: tarantool-patches@freelists.org
Subject: [PATCH] vinyl: fix memory leak in write iterator
Date: Thu, 25 Oct 2018 12:00:13 +0300	[thread overview]
Message-ID: <736abb4fa8aaba13591cdf509b180bfa21b5c87f.1540457794.git.vdavydov.dev@gmail.com> (raw)

Memory allocated for vy_write_iterator::src_heap is never freed. Fix it.
The leak was introduced by commit c174c985485c ("vinyl: implement new
simple write iterator").
---
https://github.com/tarantool/tarantool/commits/dv/vy-fix-memleak-in-write-iterator

 src/box/vy_write_iterator.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/box/vy_write_iterator.c b/src/box/vy_write_iterator.c
index 1b54e539..2fa66bd7 100644
--- a/src/box/vy_write_iterator.c
+++ b/src/box/vy_write_iterator.c
@@ -443,6 +443,7 @@ vy_write_iterator_close(struct vy_stmt_stream *vstream)
 	assert(vstream->iface->close == vy_write_iterator_close);
 	struct vy_write_iterator *stream = (struct vy_write_iterator *)vstream;
 	vy_write_iterator_stop(vstream);
+	vy_source_heap_destroy(&stream->src_heap);
 	tuple_format_unref(stream->format);
 	free(stream);
 }
-- 
2.11.0

             reply	other threads:[~2018-10-25  9:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25  9:00 Vladimir Davydov [this message]
2018-10-25  9:56 ` Vladimir Davydov

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=736abb4fa8aaba13591cdf509b180bfa21b5c87f.1540457794.git.vdavydov.dev@gmail.com \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH] vinyl: fix memory leak in write iterator' \
    /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