Fixed: [Mem error when more multiple uses on top level with multiple statements in grouping](https://github.com/clicon/clixon/issues/583)

This commit is contained in:
Olof hagsand 2024-12-05 15:44:01 +01:00
parent 30f9e174fa
commit 21476c1399
4 changed files with 19 additions and 11 deletions

View file

@ -1148,21 +1148,18 @@ ys_prune_self(yang_stmt *ys)
int retval = -1;
yang_stmt *yp;
yang_stmt *yc;
int i;
int inext;
if ((yp = yang_parent_get(ys)) != NULL){
i = 0;
inext = 0;
/* Find order of ys in child-list */
while ((yc = yn_iter(yp, &inext)) != NULL) {
if (ys == yc)
break;
i++;
}
if (yc != NULL){
assert(yc == ys);
ys_prune(yp, i);
ys_prune(yp, inext-1);
}
}
retval = 0;