This is an archive of the discontinued LLVM Phabricator instance.

Fix Mem leak in LLVMTargetMachine.cpp
ClosedPublic

Authored by XinWang10 on Apr 11 2023, 3:13 AM.

Details

Summary

If we go to line 302, with one of MCE or MAB is not nullptr, then we could
leak mem here.
Use unique_ptr to maintain these 2 pointer can avoid it.

Diff Detail

Event Timeline

XinWang10 created this revision.Apr 11 2023, 3:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2023, 3:13 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
XinWang10 requested review of this revision.Apr 11 2023, 3:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2023, 3:13 AM
  • use unique_ptr instead
XinWang10 retitled this revision from draft fix to Fix Mem leak in LLVMTargetMachine.cpp.Apr 12 2023, 12:47 AM
XinWang10 edited the summary of this revision. (Show Details)Apr 12 2023, 12:53 AM
This revision is now accepted and ready to land.Apr 12 2023, 1:49 AM
This revision was automatically updated to reflect the committed changes.