Skip to content

Commit 2650f0d

Browse files
committed
TestFoundation: fix a double free
No allocation was made to perform the explicit deallocation. Doing so causes a double free which the Windows C library caught.
1 parent 95b8e5c commit 2650f0d

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

TestFoundation/TestNSKeyedArchiver.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,6 @@ class TestNSKeyedArchiver : XCTestCase {
295295
let s1 = String(cString: charPtr)
296296
let s2 = String(cString: expectedCharPtr!)
297297

298-
#if !DEPLOYMENT_RUNTIME_OBJC
299-
// On Darwin decoded strings would belong to the autorelease pool, but as we don't have
300-
// one in SwiftFoundation let's explicitly deallocate it here.
301-
expectedCharPtr!.deallocate()
302-
#endif
303298
return s1 == s2
304299
})
305300
}

0 commit comments

Comments
 (0)