diff --git a/src/tree_schema.c b/src/tree_schema.c index 071bb52cd..33bec0044 100644 --- a/src/tree_schema.c +++ b/src/tree_schema.c @@ -3285,7 +3285,9 @@ lys_node_dup_recursion(struct lys_module *module, struct lys_node *parent, const } } } else { - memcpy(retval->iffeature, node->iffeature, retval->iffeature_size * sizeof *retval->iffeature); + if (node->iffeature_size) { + memcpy(retval->iffeature, node->iffeature, retval->iffeature_size * sizeof *retval->iffeature); + } } /*