From: Steinar H. Gunderson Date: Thu, 8 Oct 2020 20:52:47 +0000 (+0200) Subject: Fix a harmless memory leak in plocate-build. X-Git-Tag: 1.0.0~27 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=03cee8f4420aea2ee7c59821c70ed540e00fcfad;hp=1b0b1f79f9b101e1592cbd186629d57e9eb50cca;p=plocate Fix a harmless memory leak in plocate-build. --- 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();