[PATCH] D39208: [Analyzer] Do not use static storage to for implementations created in BodyFarm.cpp
Alexander Kornienko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 24 15:52:49 PDT 2017
alexfh added inline comments.
Comment at: cfe/trunk/lib/Analysis/AnalysisDeclContext.cpp:607
+ if (!BdyFrm)
+ delete BdyFrm;
This is an almost guaranteed memory leak. I think, you meant `if (BdyFrm) delete BdyFrm;`. But `delete` deals well with `nullptr`, so just delete the pointer unconditionally. But first consider making `BdyFrm` a `std::unique_ptr`. From a cursory look I don't see any reasons not to.
More information about the cfe-commits