Skip to content

Commit eb918de

Browse files
authored
Merge pull request #573 from artemcm/FreeFixes
Add `free()` workaround that causes error when built with some compiler versions.
2 parents 2f2a3f8 + f5247f4 commit eb918de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SwiftDriver/SwiftScan/SwiftScan.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,5 +360,5 @@ func withArrayOfCStrings(_ strings: [String],
360360
let _ = unsafeCStrings.withUnsafeBufferPointer {
361361
action(UnsafeMutablePointer(mutating: $0.baseAddress))
362362
}
363-
for ptr in cstrings { free(ptr) }
363+
for ptr in cstrings { if let ptr = ptr { free(ptr) } }
364364
}

0 commit comments

Comments
 (0)