From e39589f216a42fd1609103d10b818474e42a9635 Mon Sep 17 00:00:00 2001 From: Michael Uleysky Date: Wed, 9 Sep 2015 13:39:42 +1000 Subject: [PATCH] Fix memory leak --- src/deptree.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/deptree.cpp b/src/deptree.cpp index bd8b8a2..f37b825 100644 --- a/src/deptree.cpp +++ b/src/deptree.cpp @@ -274,6 +274,7 @@ void TreeEvaluate(std::mutex* mtx, int* errflag, DepTree::LeafVector* leafs, con } mtx[1].unlock(); // End locked section + delete eob; leaf->parents.clear(); delete leaf; } @@ -364,6 +365,7 @@ void TreeEvaluate(int* errflag, DepTree::LeafVector* leafs) // If node have no children, it's a new leaf node if(0==i->childrens.size() && DepTree::ROOT!=i->type) leafs->push_back(i); } + delete eob; leaf->parents.clear(); delete leaf; }