Avoid possible memory leaks in case of exceptions
Change-Id: Ibadadacbe09a93e7d7a7210868c52a8fa582d427
This commit is contained in:
@@ -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 )
|
||||
{
|
||||
|
Reference in New Issue
Block a user