diff --git a/modules/ripple_basics/utility/ripple_Log.cpp b/modules/ripple_basics/utility/ripple_Log.cpp index 099edc78f9..c9a6701061 100644 --- a/modules/ripple_basics/utility/ripple_Log.cpp +++ b/modules/ripple_basics/utility/ripple_Log.cpp @@ -281,10 +281,13 @@ void Log::setLogFile (boost::filesystem::path const& path) outStream = newStream; - if (pathToLog != NULL) - delete pathToLog; + if (pathToLog != &path) + { + if (pathToLog != NULL) + delete pathToLog; - pathToLog = new boost::filesystem::path (path); + pathToLog = new boost::filesystem::path (path); + } } bool LogPartition::setSeverity (const std::string& partition, LogSeverity severity)