File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ int CppCheckExecutor::check_internal(CppCheck& cppcheck)
301301 mLatestProgressOutputTime = std::time (nullptr );
302302
303303 if (!settings.outputFile .empty ()) {
304- mErrorOutput = new std::ofstream (settings.outputFile );
304+ mErrorOutput = safe_ptr<std::ofstream>( new std::ofstream (settings.outputFile ) );
305305 }
306306
307307 if (settings.xml ) {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ template<typename T>
3030class safe_ptr
3131{
3232public:
33- safe_ptr (T* p)
33+ explicit safe_ptr (T* p)
3434 : mPtr(p)
3535 {}
3636
@@ -58,7 +58,7 @@ class safe_ptr
5858 return *mPtr ;
5959 }
6060
61- operator bool () const NOEXCEPT {
61+ explicit operator bool () const NOEXCEPT {
6262 return mPtr != nullptr ;
6363 }
6464
You can’t perform that action at this time.
0 commit comments