Fix for issue #9775. Added check for open() returning a NULL pointer.
This commit is contained in:
parent
7ff4a538a8
commit
40f11f8872
1 changed files with 8 additions and 7 deletions
13
src/util.cpp
13
src/util.cpp
|
@ -214,12 +214,13 @@ void OpenDebugLog()
|
|||
assert(vMsgsBeforeOpenLog);
|
||||
boost::filesystem::path pathDebug = GetDataDir() / "debug.log";
|
||||
fileout = fopen(pathDebug.string().c_str(), "a");
|
||||
if (fileout) setbuf(fileout, NULL); // unbuffered
|
||||
|
||||
// dump buffered messages from before we opened the log
|
||||
while (!vMsgsBeforeOpenLog->empty()) {
|
||||
FileWriteStr(vMsgsBeforeOpenLog->front(), fileout);
|
||||
vMsgsBeforeOpenLog->pop_front();
|
||||
if (fileout) {
|
||||
setbuf(fileout, NULL); // unbuffered
|
||||
// dump buffered messages from before we opened the log
|
||||
while (!vMsgsBeforeOpenLog->empty()) {
|
||||
FileWriteStr(vMsgsBeforeOpenLog->front(), fileout);
|
||||
vMsgsBeforeOpenLog->pop_front();
|
||||
}
|
||||
}
|
||||
|
||||
delete vMsgsBeforeOpenLog;
|
||||
|
|
Loading…
Reference in a new issue