tree data UPDATE forbid unlinking list keys
diff --git a/src/tree_data_free.c b/src/tree_data_free.c
index 1c0521d..0281ae5 100644
--- a/src/tree_data_free.c
+++ b/src/tree_data_free.c
@@ -189,7 +189,7 @@
 
     /* unlink only the nodes from the first level, nodes in subtree are freed all, so no unlink is needed */
     if (top) {
-        lyd_unlink_tree(node);
+        lyd_unlink(node);
     }
 
     free(node);