[tarantool-patches] [PATCH] vinyl: fix memory leak in write iterator

  • From: Vladimir Davydov <vdavydov.dev@xxxxxxxxx>
  • To: kostja@xxxxxxxxxxxxx
  • Date: Thu, 25 Oct 2018 12:00:13 +0300

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


Other related posts: