changeset 8062:ed2d3e7e7e36

10L found by jeroen dobbelaere <jeroen dot dobbelaere at acunia dot com>
author albeu
date Sat, 02 Nov 2002 22:44:15 +0000
parents dc7565b29e0a
children 4c7ef4aeb88b
files playtree.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
+  }
     
 
 }