schema compile BUGFIX dev node copy double free in extensions
Fixes #1621
diff --git a/src/schema_compile_amend.c b/src/schema_compile_amend.c
index 0cb0c84..13e1a47 100644
--- a/src/schema_compile_amend.c
+++ b/src/schema_compile_amend.c
@@ -1508,6 +1508,8 @@
void
lysp_dev_node_free(const struct ly_ctx *ctx, struct lysp_node *dev_pnode)
{
+ LY_ARRAY_COUNT_TYPE u;
+
if (!dev_pnode) {
return;
}
@@ -1550,6 +1552,12 @@
return;
}
+ /* extension parsed tree and children were not duplicated */
+ LY_ARRAY_FOR(dev_pnode->exts, u) {
+ dev_pnode->exts[u].parsed = NULL;
+ dev_pnode->exts[u].child = NULL;
+ }
+
lysp_node_free((struct ly_ctx *)ctx, dev_pnode);
}