diff --git a/Sources/ZIPFoundation/Data+Serialization.swift b/Sources/ZIPFoundation/Data+Serialization.swift index f008a9ae..12340f90 100644 --- a/Sources/ZIPFoundation/Data+Serialization.swift +++ b/Sources/ZIPFoundation/Data+Serialization.swift @@ -84,6 +84,7 @@ extension Data { let bytesRead = fread(bytes, 1, size, file) let error = ferror(file) if error > 0 { + bytes.deallocate() throw DataError.unreadableFile } #if swift(>=4.1)