Skip to content

Commit d392563

Browse files
authored
Revert "Fix memory leak in Offloading API" (#161465)
Reverts #161430
1 parent f29f111 commit d392563

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Object/OffloadBundle.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,14 @@ OffloadBundleFatBin::create(MemoryBufferRef Buf, uint64_t SectionOffset,
120120
if (identify_magic(Buf.getBuffer()) != file_magic::offload_bundle)
121121
return errorCodeToError(object_error::parse_failed);
122122

123-
std::unique_ptr<OffloadBundleFatBin> TheBundle(
124-
new OffloadBundleFatBin(Buf, FileName));
123+
OffloadBundleFatBin *TheBundle = new OffloadBundleFatBin(Buf, FileName);
125124

126125
// Read the Bundle Entries
127126
Error Err = TheBundle->readEntries(Buf.getBuffer(), SectionOffset);
128127
if (Err)
129128
return Err;
130129

131-
return TheBundle;
130+
return std::unique_ptr<OffloadBundleFatBin>(TheBundle);
132131
}
133132

134133
Error OffloadBundleFatBin::extractBundle(const ObjectFile &Source) {

0 commit comments

Comments
 (0)