diff --git a/src/util.cpp b/src/util.cpp index 7f7325f463..2c88d80bed 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -50,6 +50,8 @@ setTreeNodeRed(Thread*, object n, bool red) inline object cloneTreeNode(Thread* t, object n) { + PROTECT(t, n); + object newNode = makeTreeNode (t, getTreeNodeValue(t, n), treeNodeLeft(t, n), treeNodeRight(t, n)); setTreeNodeRed(t, newNode, treeNodeRed(t, n));