-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
| Previous ID | SR-6449 |
| Radar | None |
| Original Reporter | oc243 (JIRA User) |
| Type | Bug |
| Status | Resolved |
| Resolution | Done |
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Foundation |
| Labels | Bug, Leak |
| Assignee | @spevans |
| Priority | Medium |
md5: ed00226ba5251454be00fae148b361f3
Issue Description:
FileManager.removeItem(atPath: ) leaks when removing a non-empty directory, as shown in this repro:
func removeItem() throws -> () {
let fm = FileManager()
while true {
let _ = try fm.createDirectory(atPath: "/tmp/foo", withIntermediateDirectories: true, attributes: [:])
let _ = fm.createFile(atPath: "/tmp/foo/bar", contents: nil)
try fm.removeItem(atPath: "/tmp/foo/")
}
}Looks like the issue is that Foundation.FileManager.fileSystemRepresentation returns a C-string that is not free'd in the caller (and can't be free'd by an autorelease pool on Linux).