llvm.org GIT mirror llvm / 6a94651
llvm-undname: Attempt to fix leak-on-invalid found by oss-fuzz git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358760 91177308-0d34-0410-b5e6-96231b3b80d8 Nico Weber 1 year, 7 months ago
1 changed file(s) with 6 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
12291229
12301230 EncodedStringLiteralNode *Result = Arena.alloc();
12311231
1232 // Must happen before the first `goto StringLiteralError`.
1233 if (!initializeOutputStream(nullptr, nullptr, OS, 1024))
1234 // FIXME: Propagate out-of-memory as an error?
1235 std::terminate();
1236
12321237 // Prefix indicating the beginning of a string literal
12331238 if (!MangledName.consumeFront("@_"))
12341239 goto StringLiteralError;
12601265 if (MangledName.empty())
12611266 goto StringLiteralError;
12621267
1263 if (!initializeOutputStream(nullptr, nullptr, OS, 1024))
1264 // FIXME: Propagate out-of-memory as an error?
1265 std::terminate();
12661268 if (IsWcharT) {
12671269 Result->Char = CharKind::Wchar;
12681270 if (StringByteSize > 64)
13271329
13281330 StringLiteralError:
13291331 Error = true;
1332 std::free(OS.getBuffer());
13301333 return nullptr;
13311334 }
13321335