mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-17 18:40:09 +00:00
40f11f8 Fix for issue #9775. Added check for open() returning a NULL pointer. (kirit93)
This commit is contained in:
commit
8ad31f9aa3
15
src/util.cpp
15
src/util.cpp
@ -214,12 +214,13 @@ void OpenDebugLog()
|
|||||||
assert(vMsgsBeforeOpenLog);
|
assert(vMsgsBeforeOpenLog);
|
||||||
boost::filesystem::path pathDebug = GetDataDir() / "debug.log";
|
boost::filesystem::path pathDebug = GetDataDir() / "debug.log";
|
||||||
fileout = fopen(pathDebug.string().c_str(), "a");
|
fileout = fopen(pathDebug.string().c_str(), "a");
|
||||||
if (fileout) setbuf(fileout, NULL); // unbuffered
|
if (fileout) {
|
||||||
|
setbuf(fileout, NULL); // unbuffered
|
||||||
// dump buffered messages from before we opened the log
|
// dump buffered messages from before we opened the log
|
||||||
while (!vMsgsBeforeOpenLog->empty()) {
|
while (!vMsgsBeforeOpenLog->empty()) {
|
||||||
FileWriteStr(vMsgsBeforeOpenLog->front(), fileout);
|
FileWriteStr(vMsgsBeforeOpenLog->front(), fileout);
|
||||||
vMsgsBeforeOpenLog->pop_front();
|
vMsgsBeforeOpenLog->pop_front();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete vMsgsBeforeOpenLog;
|
delete vMsgsBeforeOpenLog;
|
||||||
@ -838,4 +839,4 @@ std::string CopyrightHolders(const std::string& strPrefix)
|
|||||||
strCopyrightHolders += "\n" + strPrefix + "The Bitcoin Core developers";
|
strCopyrightHolders += "\n" + strPrefix + "The Bitcoin Core developers";
|
||||||
}
|
}
|
||||||
return strCopyrightHolders;
|
return strCopyrightHolders;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user