mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
BufferedFile: fclose at destruction
This is currently indirectly implied by src/bench/load_external.cpp:LoadExternalBlockFile "The file will be closed by LoadExternalBlockFile()."
This commit is contained in:
parent
55bd5d8015
commit
88fe778d9d
2 changed files with 8 additions and 0 deletions
|
@ -520,6 +520,10 @@ public:
|
|||
throw std::ios_base::failure("Rewind limit must be less than buffer size");
|
||||
}
|
||||
|
||||
~BufferedFile() { fclose(); }
|
||||
|
||||
int fclose() { return m_src.fclose(); }
|
||||
|
||||
//! check whether we're at the end of the source file
|
||||
bool eof() const {
|
||||
return m_read_pos == nSrcPos && m_src.feof();
|
||||
|
|
|
@ -65,4 +65,8 @@ FUZZ_TARGET(buffered_file)
|
|||
}
|
||||
opt_buffered_file->GetPos();
|
||||
}
|
||||
if (opt_buffered_file) {
|
||||
opt_buffered_file->fclose();
|
||||
opt_buffered_file.reset();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue