Skip to content

Commit 8eca58f

Browse files
authored
Merge pull request #952 from spevans/pr_throw_leak
2 parents 905ef56 + 70617e6 commit 8eca58f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Foundation/NSData.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ open class NSData : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {
406406
}
407407

408408
if remaining != 0 {
409+
free(data)
409410
throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno), userInfo: nil)
410411
}
411412

0 commit comments

Comments
 (0)