Skip to content

Commit

Permalink
Fix possible memory leak within readChunk
Browse files Browse the repository at this point in the history
  • Loading branch information
kbinani committed Aug 26, 2024
1 parent 4c6469a commit ad927f5
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 ad927f5

Please sign in to comment.