Looking over the clang static analyzer, came across this old memory leak - looks like it's been around for at least four years. These two methods both call a formatters::*SyntheticFrontEndCreator method which new's an object and returns a pointer to it; they save save that pointer but never call delete. This patch puts it in an auto_ptr so it'll be destroyed when it goes out of scope.
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
@jasonmolenda you might want to use std::unique_ptr instead -- probably LLVM won't migrate to 17 for a while, but still.
Comment Actions
And you can write it as
std::unique_ptr<SyntheticChildrenFrontEnd> synthetic_children = std::make_unique(...);