]> git.sesse.net Git - stockfish/blobdiff - src/misc.cpp
Fix a Windows-only crash on exit without 'quit'
[stockfish] / src / misc.cpp
index b1c0feeb9e139b6b91476663d5a5987872746c0e..e0cc6ed5977d9d39b838d5cf99e6ea1d92777f37 100644 (file)
@@ -390,7 +390,7 @@ void* aligned_ttmem_alloc(size_t allocSize, void*& mem) {
 
 void aligned_ttmem_free(void* mem) {
 
-  if (!VirtualFree(mem, 0, MEM_RELEASE))
+  if (mem && !VirtualFree(mem, 0, MEM_RELEASE))
   {
       DWORD err = GetLastError();
       std::cerr << "Failed to free transposition table. Error code: 0x" <<