diff --git a/src/3rdparty/masm/stubs/WTFStubs.cpp b/src/3rdparty/masm/stubs/WTFStubs.cpp index b26d10b3ab..f408b355f5 100644 --- a/src/3rdparty/masm/stubs/WTFStubs.cpp +++ b/src/3rdparty/masm/stubs/WTFStubs.cpp @@ -66,7 +66,7 @@ uint32_t cryptographicallyRandomNumber() return 0; } -static FilePrintStream* s_dataFile; +static FilePrintStream* s_dataFile = nullptr; void setDataFile(FilePrintStream *ps) { diff --git a/src/3rdparty/masm/wtf/FilePrintStream.cpp b/src/3rdparty/masm/wtf/FilePrintStream.cpp index a56b36526e..8ddf8487bd 100644 --- a/src/3rdparty/masm/wtf/FilePrintStream.cpp +++ b/src/3rdparty/masm/wtf/FilePrintStream.cpp @@ -39,7 +39,8 @@ FilePrintStream::~FilePrintStream() { if (m_adoptionMode == Borrow) return; - fclose(m_file); + if (m_file) + fclose(m_file); } std::unique_ptr FilePrintStream::open(const char* filename, const char* mode)