-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Fix memory leak in Offloading API #161430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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