Fix memory leak in Offloading API#161430
Conversation
|
@llvm/pr-subscribers-llvm-binary-utilities Author: David Salinas (david-salinas) ChangesFix or the failing Sanitizer buildbots from PR: #143342 Full diff: https://github.com/llvm/llvm-project/pull/161430.diff 1 Files Affected:
diff --git a/llvm/lib/Object/OffloadBundle.cpp b/llvm/lib/Object/OffloadBundle.cpp
index 0dd378e65fd81..7c84e9b92032d 100644
--- a/llvm/lib/Object/OffloadBundle.cpp
+++ b/llvm/lib/Object/OffloadBundle.cpp
@@ -120,14 +120,14 @@ OffloadBundleFatBin::create(MemoryBufferRef Buf, uint64_t SectionOffset,
if (identify_magic(Buf.getBuffer()) != file_magic::offload_bundle)
return errorCodeToError(object_error::parse_failed);
- OffloadBundleFatBin *TheBundle = new OffloadBundleFatBin(Buf, FileName);
+ std::unique_ptr<OffloadBundleFatBin> TheBundle(new OffloadBundleFatBin(Buf, FileName));
// Read the Bundle Entries
Error Err = TheBundle->readEntries(Buf.getBuffer(), SectionOffset);
if (Err)
return Err;
- return std::unique_ptr<OffloadBundleFatBin>(TheBundle);
+ return TheBundle;
}
Error OffloadBundleFatBin::extractBundle(const ObjectFile &Source) {
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
lamb-j
left a comment
There was a problem hiding this comment.
lgtm, can you add the clang-format suggestion?
ok latest patch addresses the clang-format failures |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/116/builds/19080 Here is the relevant piece of the build log for the reference |
|
Hello, This PR appears to break our bot due to a build error. Could you please fix it. Thanks!
bot: https://lab.llvm.org/buildbot/#/builders/140/builds/31640 |
Fix or the failing Sanitizer buildbots from PR: llvm#143342
Fix or the failing Sanitizer buildbots from PR: #143342