Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1113#discussion_r120712778
--- Diff: core/sql/optimizer/ControlDB.cpp ---
@@ -108,7 +108,12 @@ ControlDB::~ControlDB()
void ControlDB::setRequiredShape(ControlQueryShape *shape)
{
- delete requiredShape_;
+ if (requiredShape_)
+ {
+ delete requiredShape_->getShape();
+ delete requiredShape_;
--- End diff --
Yes, one thing I don't like about NABasicObject is that the heap pointer is
junk for NABasicObjects that are allocated on the stack. Fortunately that's not
a problem here. The allocation/deallocation of objects is pretty clear in this
file. Thanks again for finding this leak!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---