data tree BUGFIX avoid freeing empty values
@@ -1207,7 +1207,9 @@ lyd_change_term(struct lyd_node *term, const char *val_str)
} /* else value changed, LY_SUCCESS */
cleanup:
+ if (val.realtype) {
type->plugin->free(LYD_CTX(term), &val);
+ }
return ret;
}
