diff --git a/src/util/readwritefile.cpp b/src/util/readwritefile.cpp index 15e9d7a9b91..a45c41d367d 100644 --- a/src/util/readwritefile.cpp +++ b/src/util/readwritefile.cpp @@ -40,6 +40,8 @@ bool WriteBinaryFile(const fs::path &filename, const std::string &data) fclose(f); return false; } - fclose(f); + if (fclose(f) != 0) { + return false; + } return true; }