Close writer on error during write.

This commit is contained in:
Rouven Spreckels 2020-10-07 10:07:21 +02:00
parent e9a1de4e1b
commit a74045654f

View file

@ -176,6 +176,7 @@ impl<W: Write + io::Seek> Write for ZipWriter<W> {
if self.stats.bytes_written > 0xFFFFFFFF
&& !self.files.last_mut().unwrap().large_file
{
let _inner = mem::replace(&mut self.inner, GenericZipWriter::Closed);
return Err(io::Error::new(
io::ErrorKind::Other,
"Large file option has not been set",