Skip to content

Commit 2ac9115

Browse files
committed
tree data BUGFIX lyd_new_any value check
1 parent d559bb2 commit 2ac9115

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tree_data_new.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,8 @@ lyd_new_any(struct lyd_node *parent, const struct lys_module *module, const char
974974
struct lysc_ext_instance *ext = NULL;
975975
const struct ly_ctx *ctx = parent ? LYD_CTX(parent) : (module ? module->ctx : NULL);
976976

977-
LY_CHECK_ARG_RET(ctx, parent || module, parent || node, name, (value_type == LYD_ANYDATA_DATATREE) || value, LY_EINVAL);
977+
LY_CHECK_ARG_RET(ctx, parent || module, parent || node, name,
978+
(value_type == LYD_ANYDATA_DATATREE) || (value_type == LYD_ANYDATA_STRING) || value, LY_EINVAL);
978979
LY_CHECK_CTX_EQUAL_RET(parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
979980

980981
if (!module) {

0 commit comments

Comments
 (0)