path FEATURE new compiled path structure (#1108)
Refactoring includes using it for
instance-identifier and for checking leafref,
it is evaluated using stanrad XPath. Predicates
used for lyd_new_list2(), tests included.
diff --git a/src/tree_schema_free.c b/src/tree_schema_free.c
index bdc65ed..60d91e8 100644
--- a/src/tree_schema_free.c
+++ b/src/tree_schema_free.c
@@ -16,6 +16,7 @@
#include "common.h"
#include "config.h"
+#include "path.h"
#include "plugins_exts.h"
#include "plugins_types.h"
#include "tree.h"
@@ -144,6 +145,7 @@
}
void lysc_type_free(struct ly_ctx *ctx, struct lysc_type *type);
+
void
lysp_type_free(struct ly_ctx *ctx, struct lysp_type *type)
{
@@ -153,7 +155,7 @@
FREE_ARRAY(ctx, type->patterns, lysp_restr_free);
FREE_ARRAY(ctx, type->enums, lysp_type_enum_free);
FREE_ARRAY(ctx, type->bits, lysp_type_enum_free);
- FREE_STRING(ctx, type->path);
+ lyxp_expr_free(ctx, type->path);
FREE_STRINGS(ctx, type->bases);
FREE_ARRAY(ctx, type->types, lysp_type_free);
FREE_ARRAY(ctx, type->exts, lysp_ext_instance_free);
@@ -638,7 +640,7 @@
FREE_ARRAY(ctx, ((struct lysc_type_union*)type)->types, lysc_type2_free);
break;
case LY_TYPE_LEAFREF:
- FREE_STRING(ctx, ((struct lysc_type_leafref*)type)->path);
+ lyxp_expr_free(ctx, ((struct lysc_type_leafref*)type)->path);
break;
case LY_TYPE_INST:
case LY_TYPE_BOOL: