[ScanDependencies] Fix a memory leak in dependency graph

Fix a memory leak from https://github.com/swiftlang/swift/pull/75134.
This commit is contained in:
Steven Wu
2024-07-15 12:38:27 -07:00
parent a3bf1fc4c2
commit ed936853dc
4 changed files with 9 additions and 10 deletions

View File

@@ -247,7 +247,7 @@ static void
writeMacroDependencies(llvm::raw_ostream &out,
const swiftscan_macro_dependency_set_t *macro_deps,
unsigned indentLevel, bool trailingComma) {
if (macro_deps->count == 0)
if (!macro_deps)
return;
out.indent(indentLevel * 2);