- store the next node in a separate variable so we won't loose it after freeing the...
authorKamil Hornicek <kamil.hornicek@reactos.org>
Fri, 21 Nov 2008 13:20:22 +0000 (13:20 +0000)
committerKamil Hornicek <kamil.hornicek@reactos.org>
Fri, 21 Nov 2008 13:20:22 +0000 (13:20 +0000)
svn path=/trunk/; revision=37510

reactos/dll/win32/glu32/libtess/dict.c

index 76fbbea..7216d38 100644 (file)
@@ -67,10 +67,13 @@ Dict *dictNewDict( void *frame,
 /* really __gl_dictListDeleteDict */
 void dictDeleteDict( Dict *dict )
 {
-  DictNode *node;
+  DictNode *node, *next;
 
-  for( node = dict->head.next; node != &dict->head; node = node->next ) {
+  node = dict->head.next;
+  while(node != &dict->head) {
+    next = node->next;
     memFree( node );
+    node = next;
   }
   memFree( dict );
 }