From 03cee8f4420aea2ee7c59821c70ed540e00fcfad Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 8 Oct 2020 22:52:47 +0200 Subject: [PATCH] Fix a harmless memory leak in plocate-build. --- plocate-build.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plocate-build.cpp b/plocate-build.cpp index be8a818..c571b09 100644 --- a/plocate-build.cpp +++ b/plocate-build.cpp @@ -147,6 +147,12 @@ public: : invindex(new PostingListBuilder *[NUM_TRIGRAMS]), outfp(outfp), block_size(block_size) { fill(invindex.get(), invindex.get() + NUM_TRIGRAMS, nullptr); } + ~Corpus() { + for (unsigned i = 0; i < NUM_TRIGRAMS; ++i) { + delete invindex[i]; + } + } + void add_file(string filename); void flush_block(); -- 2.39.5