From d03d1ad55e0ef37d922aa88a7ed23ed4f7fdca02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 15 Dec 2014 09:22:15 +0000 Subject: [PATCH] coverity#704150 Resource leak in object and coverity#704151 Resource leak in object coverity#704152 Resource leak in object Change-Id: I68c455adc25375b8027236fd44d99a397e372994 --- helpcompiler/source/HelpCompiler.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/helpcompiler/source/HelpCompiler.cxx b/helpcompiler/source/HelpCompiler.cxx index a43864f36603..03cb4f47f7c0 100644 --- a/helpcompiler/source/HelpCompiler.cxx +++ b/helpcompiler/source/HelpCompiler.cxx @@ -247,9 +247,9 @@ public: std::string documentId; std::string fileName; std::string title; - HashSet *hidlist; - Hashtable *keywords; - Stringtable *helptexts; + std::unique_ptr hidlist; + std::unique_ptr keywords; + std::unique_ptr helptexts; private: HashSet extendedHelpText; public: @@ -257,9 +257,9 @@ public: const std::string &intitle) : documentId(indocumentId), fileName(infileName), title(intitle) { - hidlist = new HashSet; - keywords = new Hashtable; - helptexts = new Stringtable; + hidlist.reset(new HashSet); + keywords.reset(new Hashtable); + helptexts.reset(new Stringtable); } void traverse( xmlNodePtr parentNode ); private: @@ -461,9 +461,9 @@ bool HelpCompiler::compile() streamTable.dropappl(); streamTable.appl_doc = docResolvedDoc; - streamTable.appl_hidlist = aparser.hidlist; - streamTable.appl_helptexts = aparser.helptexts; - streamTable.appl_keywords = aparser.keywords; + streamTable.appl_hidlist = aparser.hidlist.release(); + streamTable.appl_helptexts = aparser.helptexts.release(); + streamTable.appl_keywords = aparser.keywords.release(); streamTable.document_id = documentId; streamTable.document_path = fileName;