Browse Source

FlushBlockFile(): check for valid FILE pointer

- don't call FileCommit() and fclose() if no valid FILE pointer was
  returned by OpenBlockFile()
0.8
Philip Kaufmann 12 years ago
parent
commit
b19388dd88
  1. 4
      src/main.cpp

4
src/main.cpp

@ -1540,13 +1540,17 @@ void static FlushBlockFile() @@ -1540,13 +1540,17 @@ void static FlushBlockFile()
posOld.nPos = 0;
FILE *fileOld = OpenBlockFile(posOld);
if (fileOld) {
FileCommit(fileOld);
fclose(fileOld);
}
fileOld = OpenUndoFile(posOld);
if (fileOld) {
FileCommit(fileOld);
fclose(fileOld);
}
}
bool FindUndoPos(int nFile, CDiskBlockPos &pos, unsigned int nAddSize);

Loading…
Cancel
Save