diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-15 09:22:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-12-15 09:33:09 +0000 |
commit | d03d1ad55e0ef37d922aa88a7ed23ed4f7fdca02 (patch) | |
tree | b41dc593bc2b5b0470e4731d3810ac2916c8ca10 /helpcompiler | |
parent | 002808e80f67839822a240b3c2a351b57248305a (diff) |
coverity#704150 Resource leak in object
and
coverity#704151 Resource leak in object
coverity#704152 Resource leak in object
Change-Id: I68c455adc25375b8027236fd44d99a397e372994
Diffstat (limited to 'helpcompiler')
-rw-r--r-- | helpcompiler/source/HelpCompiler.cxx | 18 |
1 files 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<HashSet> hidlist; + std::unique_ptr<Hashtable> keywords; + std::unique_ptr<Stringtable> 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; |