diff --git a/exercises/02/vslc/src/tree.c b/exercises/02/vslc/src/tree.c index 108c644..678888f 100644 --- a/exercises/02/vslc/src/tree.c +++ b/exercises/02/vslc/src/tree.c @@ -68,11 +68,11 @@ node_print ( node_t *root, int nesting ) printf ( "%*c%p\n", nesting, ' ', root ); } -// The discard should have zero children here. If not -> MEMORY LEAK + static void node_finalize ( node_t *discard ) -{ - // Free the data and the children lists. +{ // The discard should have zero children here. If not -> MEMORY LEAK + // Free the data and the children list. free(discard->data); free(discard->children); free(discard); @@ -87,7 +87,7 @@ destroy_subtree ( node_t *discard ) return; // This will not run if n_children is zero - // If non-zero, destroy all child recursivly + // If non-zero, destroy all children recursivly while (discard->n_children--) destroy_subtree(discard->children[discard->n_children]);