Skip to content

Commit

Permalink
Fixed CORE-6331 - Memory leak with some statements and expressions.
Browse files Browse the repository at this point in the history
  • Loading branch information
asfernandes committed Jun 11, 2020
1 parent c57c4fc commit 98054a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/dsql/Nodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ class AggNode : public TypedNode<ValueExprNode, ExprNode::TYPE_AGGREGATE>

AggNode* newInstance(MemoryPool& pool) const
{
return FB_NEW T(pool);
return FB_NEW_POOL(pool) T(pool);
}
};

Expand All @@ -932,7 +932,7 @@ class AggNode : public TypedNode<ValueExprNode, ExprNode::TYPE_AGGREGATE>

AggNode* newInstance(MemoryPool& pool) const
{
return FB_NEW T(pool, type);
return FB_NEW_POOL(pool) T(pool, type);
}

public:
Expand Down
4 changes: 2 additions & 2 deletions src/dsql/StmtNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7182,7 +7182,7 @@ StmtNode* StoreNode::dsqlPass(DsqlCompilerScratch* dsqlScratch)
if (!needSavePoint || nodeIs<SavepointEncloseNode>(node))
return node;

return FB_NEW SavepointEncloseNode(dsqlScratch->getPool(), node);
return FB_NEW_POOL(dsqlScratch->getPool()) SavepointEncloseNode(dsqlScratch->getPool(), node);
}

string StoreNode::internalPrint(NodePrinter& printer) const
Expand Down Expand Up @@ -8888,7 +8888,7 @@ StmtNode* UpdateOrInsertNode::dsqlPass(DsqlCompilerScratch* dsqlScratch)
if (!needSavePoint || nodeIs<SavepointEncloseNode>(ret))
return ret;

return FB_NEW SavepointEncloseNode(dsqlScratch->getPool(), ret);
return FB_NEW_POOL(dsqlScratch->getPool()) SavepointEncloseNode(dsqlScratch->getPool(), ret);
}

string UpdateOrInsertNode::internalPrint(NodePrinter& printer) const
Expand Down

0 comments on commit 98054a2

Please sign in to comment.