Skip to content

Commit

Permalink
Merge pull request #331 from kbinani/fix-memory-leadk-at-data-readchunk
Browse files Browse the repository at this point in the history
Fix a possible memory leak in Data.readChunk
  • Loading branch information
weichsel authored Sep 2, 2024
2 parents 8df974e + ad927f5 commit fac78df
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Sources/ZIPFoundation/Data+Serialization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fac78df

Please sign in to comment.