fix invalid pointer usage in bezierPatchDeleteList(), bug 11807
authorBrian <brian.paul@tungstengraphics.com>
Thu, 2 Aug 2007 14:40:29 +0000 (08:40 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 2 Aug 2007 14:40:29 +0000 (08:40 -0600)
src/glu/sgi/libnurbs/interface/bezierPatch.cc

index 836ae94e0a6354c6630016d9c3a64b32a804cf85..5b7bda1a0017f575dc9119cabf7337d8fcbf0199 100644 (file)
@@ -111,8 +111,11 @@ void bezierPatchDelete(bezierPatch *b)
 void bezierPatchDeleteList(bezierPatch *b)
 {
   bezierPatch *temp;
-  for(temp = b; temp != NULL; temp = temp->next)
-    bezierPatchDelete(temp);
+  while (b != NULL) {
+    temp = b;
+    b = b->next;
+    bezierPatchDelete(temp);    
+  }
 }
 
 bezierPatch* bezierPatchInsert(bezierPatch *list, bezierPatch *b)