From bff1462c0b67f94207f2cf5897b3776bad121de4 Mon Sep 17 00:00:00 2001 From: Bill Stephens Date: Wed, 2 Aug 2023 09:15:48 -0500 Subject: [PATCH] data: fix merge operation lyd_merge_* functions may modify the passed dnode pointer. Make sure to update the self.cdata pointer after the operation. Fixes: #49 Signed-off-by: Bill Stephens --- libyang/data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libyang/data.py b/libyang/data.py index a8c0ed92..69649eba 100644 --- a/libyang/data.py +++ b/libyang/data.py @@ -552,6 +552,8 @@ def merge( if ret != lib.LY_SUCCESS: raise self.context.error("merge failed") + self.cdata = node_p[0] + def iter_tree(self) -> Iterator["DNode"]: n = next_n = self.cdata while n != ffi.NULL: