summaryrefslogtreecommitdiff
path: root/helpcompiler/source/HelpLinker_main.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-04-17 10:56:03 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-04-17 10:57:00 +0900
commit6a964dcf0fe3b9258d07391ada0f0d245b1f7cec (patch)
treeb9af585607c69e5f8ccd227931eab42a4f9b824c /helpcompiler/source/HelpLinker_main.cxx
parent326f8dc37bc11591e7d683b21085da7ee15b8072 (diff)
Avoid possible memory leaks in case of exceptions
Change-Id: Ibadadacbe09a93e7d7a7210868c52a8fa582d427
Diffstat (limited to 'helpcompiler/source/HelpLinker_main.cxx')
-rw-r--r--helpcompiler/source/HelpLinker_main.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/helpcompiler/source/HelpLinker_main.cxx b/helpcompiler/source/HelpLinker_main.cxx
index 83906830b21c..dd22eb99ae8a 100644
--- a/helpcompiler/source/HelpLinker_main.cxx
+++ b/helpcompiler/source/HelpLinker_main.cxx
@@ -21,6 +21,7 @@
#include <HelpLinker.hxx>
#include <iostream>
#include <sal/main.h>
+#include <boost/scoped_ptr.hpp>
SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
std::vector<std::string> args;
@@ -28,9 +29,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
args.push_back(std::string(argv[i]));
try
{
- HelpLinker* pHelpLinker = new HelpLinker();
+ boost::scoped_ptr<HelpLinker> pHelpLinker(new HelpLinker());
pHelpLinker->main( args );
- delete pHelpLinker;
}
catch( const HelpProcessingException& e )
{