From: svost Date: Sun, 8 May 2016 20:54:46 +0000 (+0300) Subject: Close file if fseek failed X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=1deecd20dfb2896866c7789044f141b388d25aca Close file if fseek failed --- diff --git a/src/main.cpp b/src/main.cpp index 48de169..98c2105 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2677,7 +2677,10 @@ FILE* AppendBlockFile(unsigned int& nFileRet) if (!file) return NULL; if (fseek(file, 0, SEEK_END) != 0) + { + fclose(file); return NULL; + } // FAT32 file size max 4GB, fseek and ftell max 2GB, so we must stay under 2GB if (ftell(file) < (long)(0x7F000000 - MAX_SIZE)) {