Skip to content

Commit 9eb038e

Browse files
authored
Merge pull request #1450 from spevans/pr_sr_6449_4.1
2 parents 8c16802 + 7b3c80e commit 9eb038e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Foundation/FileManager.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,8 @@ open class FileManager : NSObject {
460460
ps.advanced(by: 1).initialize(to: nil)
461461
let stream = fts_open(ps, FTS_PHYSICAL | FTS_XDEV | FTS_NOCHDIR, nil)
462462
ps.deinitialize(count: 2)
463-
ps.deallocate(capacity: 2)
463+
ps.deallocate()
464+
fsRep.deallocate()
464465

465466
if stream != nil {
466467
defer {
@@ -1036,7 +1037,8 @@ extension FileManager {
10361037
ps.advanced(by: 1).initialize(to: nil)
10371038
_stream = fts_open(ps, FTS_PHYSICAL | FTS_XDEV | FTS_NOCHDIR, nil)
10381039
ps.deinitialize(count: 2)
1039-
ps.deallocate(capacity: 2)
1040+
ps.deallocate()
1041+
fsRep.deallocate()
10401042
} else {
10411043
_rootError = _NSErrorWithErrno(ENOENT, reading: true, url: url)
10421044
}

TestFoundation/TestFileManager.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ class TestFileManager : XCTestCase {
140140
XCTAssertEqual(UInt8(bitPattern: result[0]), 0xE2)
141141
XCTAssertEqual(UInt8(bitPattern: result[1]), 0x98)
142142
XCTAssertEqual(UInt8(bitPattern: result[2]), 0x83)
143+
result.deallocate()
143144
}
144145

145146
func test_fileAttributes() {

0 commit comments

Comments
 (0)