data tree BUGFIX set out param
@@ -978,6 +978,9 @@ lyd_new_meta(const struct ly_ctx *ctx, struct lyd_node *parent, const struct lys
LOGERR(ctx, LY_EINVAL, "Cannot add metadata to an opaque node \"%s\".", ((struct lyd_node_opaq *)parent)->name);
return LY_EINVAL;
}
+ if (meta) {
+ *meta = NULL;
+ }
/* parse the name */
tmp = name;
@@ -1013,6 +1016,9 @@ lyd_new_meta2(const struct ly_ctx *ctx, struct lyd_node *parent, ly_bool clear_d
LOGERR(ctx, LY_EINVAL, "Cannot add metadata to an opaque node \"%s\".", ((struct lyd_node_opaq *)parent)->name);
return LY_EINVAL;
}
+ if (meta) {
+ *meta = NULL;
+ }
switch (attr->format) {
case LY_PREF_XML:
