path BUGFIX cleanup fixes
diff --git a/src/path.c b/src/path.c
index 0190811..4109f73 100644
--- a/src/path.c
+++ b/src/path.c
@@ -551,7 +551,7 @@
expr->expr + expr->tok_pos[*tok_idx] + 1, expr->tok_len[*tok_idx] - 2, NULL, format, prefix_data,
LYD_HINT_DATA, key, NULL);
LOG_LOCBACK(key ? 1 : 0, 0, 0, 0);
- LY_CHECK_GOTO(ret, cleanup);
+ LY_CHECK_ERR_GOTO(ret, p->value.realtype = NULL, cleanup);
++(*tok_idx);
/* "allocate" the type to avoid problems when freeing the value after the type was freed */
@@ -603,7 +603,7 @@
expr->expr + expr->tok_pos[*tok_idx] + 1, expr->tok_len[*tok_idx] - 2, NULL, format, prefix_data,
LYD_HINT_DATA, ctx_node, NULL);
LOG_LOCBACK(ctx_node ? 1 : 0, 0, 0, 0);
- LY_CHECK_GOTO(ret, cleanup);
+ LY_CHECK_ERR_GOTO(ret, p->value.realtype = NULL, cleanup);
++(*tok_idx);
/* "allocate" the type to avoid problems when freeing the value after the type was freed */
@@ -1112,6 +1112,10 @@
{
LY_ARRAY_COUNT_TYPE u;
+ if (!path) {
+ return;
+ }
+
LY_ARRAY_FOR(path, u) {
ly_path_predicates_free(ctx, path[u].pred_type, path[u].predicates);
}