Skip to content

Commit

Permalink
Use actual child being processed when traversing leaf list
Browse files Browse the repository at this point in the history
Previous code was using the parents first child which may
not have been the child we are currently processing
  • Loading branch information
carlgsmith committed Oct 8, 2024
1 parent 487eb1f commit be894e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions schema.c
Original file line number Diff line number Diff line change
Expand Up @@ -3392,10 +3392,10 @@ _sch_traverse_nodes (sch_instance * instance, sch_node * schema, GNode * parent,
{
if (!(flags & SCH_F_FILTER_RDEPTH) || (depth >= rdepth))
{
for (GNode *child = parent->children->children; child; child = child->next)
for (GNode *leaf = child->children; leaf; leaf = leaf->next)
{
free (child->children->data);
child->children->data = g_strdup ("");
free (leaf->children->data);
leaf->children->data = g_strdup ("");
}
}
}
Expand Down

0 comments on commit be894e3

Please sign in to comment.