From 85421351e65c45249b038214fe8d1ca6b0d69884 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 2 Aug 2007 08:40:29 -0600 Subject: [PATCH] fix invalid pointer usage in bezierPatchDeleteList(), bug 11807 --- src/glu/sgi/libnurbs/interface/bezierPatch.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/glu/sgi/libnurbs/interface/bezierPatch.cc b/src/glu/sgi/libnurbs/interface/bezierPatch.cc index 836ae94e0a6..5b7bda1a001 100644 --- a/src/glu/sgi/libnurbs/interface/bezierPatch.cc +++ b/src/glu/sgi/libnurbs/interface/bezierPatch.cc @@ -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) -- 2.30.2