From e18dfbc2f5cc99aca1ff7abbab5f9b3be2bfed73 Mon Sep 17 00:00:00 2001 From: Niklas Kurkisuo Date: Thu, 23 Dec 2010 14:48:12 +0100 Subject: Fix resource leak in QCLuceneStandardAnalyzer::QCLuceneStandardAnalyzer. CID 22165. Merge-request: 2534 Reviewed-by: Harald Fernengel --- tools/assistant/lib/fulltextsearch/qanalyzer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/assistant/lib/fulltextsearch/qanalyzer.cpp b/tools/assistant/lib/fulltextsearch/qanalyzer.cpp index 23a9f14..db2f06c 100644 --- a/tools/assistant/lib/fulltextsearch/qanalyzer.cpp +++ b/tools/assistant/lib/fulltextsearch/qanalyzer.cpp @@ -96,6 +96,12 @@ QCLuceneStandardAnalyzer::QCLuceneStandardAnalyzer(const QStringList &stopWords) tArray[stopWords.count()] = 0; d->analyzer = new lucene::analysis::standard::StandardAnalyzer(tArray); + + // free memory + for(int i = 0; i < stopWords.count(); ++i) { + delete [] tArray[i]; + } + delete [] tArray; } -- cgit v0.12