# HG changeset patch # User albeu # Date 1036277055 0 # Node ID ed2d3e7e7e36abe90c1b980a956862b95b37b017 # Parent dc7565b29e0a2ced16c9555ec8d73e0046114be4 10L found by jeroen dobbelaere diff -r dc7565b29e0a -r ed2d3e7e7e36 playtree.c --- a/playtree.c Sat Nov 02 22:39:02 2002 +0000 +++ b/playtree.c Sat Nov 02 22:44:15 2002 +0000 @@ -32,8 +32,11 @@ #endif if(childs) { - for(iter = pt->child; iter != NULL; iter = iter->next) + for(iter = pt->child; iter != NULL; ) { + play_tree_t* nxt=iter->next; play_tree_free(iter,1); + iter = nxt; + } pt->child = NULL; } @@ -64,8 +67,11 @@ for(iter = pt ; iter->prev != NULL ; iter = iter->prev) /* NOTHING */; - for( ; iter != NULL ; iter = iter->next) + while(iter) { + play_tree_t* nxt = iter->next; play_tree_free(iter,childs); + iter = nxt; + } }