coverity#704150 Resource leak in object

and

coverity#704151 Resource leak in object
coverity#704152 Resource leak in object

Change-Id: I68c455adc25375b8027236fd44d99a397e372994
This commit is contained in:
Caolán McNamara
2014-12-15 09:22:15 +00:00
parent 002808e80f
commit d03d1ad55e

View File

@@ -247,9 +247,9 @@ public:
std::string documentId; std::string documentId;
std::string fileName; std::string fileName;
std::string title; std::string title;
HashSet *hidlist; std::unique_ptr<HashSet> hidlist;
Hashtable *keywords; std::unique_ptr<Hashtable> keywords;
Stringtable *helptexts; std::unique_ptr<Stringtable> helptexts;
private: private:
HashSet extendedHelpText; HashSet extendedHelpText;
public: public:
@@ -257,9 +257,9 @@ public:
const std::string &intitle) : documentId(indocumentId), fileName(infileName), const std::string &intitle) : documentId(indocumentId), fileName(infileName),
title(intitle) title(intitle)
{ {
hidlist = new HashSet; hidlist.reset(new HashSet);
keywords = new Hashtable; keywords.reset(new Hashtable);
helptexts = new Stringtable; helptexts.reset(new Stringtable);
} }
void traverse( xmlNodePtr parentNode ); void traverse( xmlNodePtr parentNode );
private: private:
@@ -461,9 +461,9 @@ bool HelpCompiler::compile()
streamTable.dropappl(); streamTable.dropappl();
streamTable.appl_doc = docResolvedDoc; streamTable.appl_doc = docResolvedDoc;
streamTable.appl_hidlist = aparser.hidlist; streamTable.appl_hidlist = aparser.hidlist.release();
streamTable.appl_helptexts = aparser.helptexts; streamTable.appl_helptexts = aparser.helptexts.release();
streamTable.appl_keywords = aparser.keywords; streamTable.appl_keywords = aparser.keywords.release();
streamTable.document_id = documentId; streamTable.document_id = documentId;
streamTable.document_path = fileName; streamTable.document_path = fileName;