From a5d0231c8f0473607f58a1efa23333c09f1c293e Mon Sep 17 00:00:00 2001 From: Roland Baer Date: Thu, 2 Aug 2007 11:19:11 +0300 Subject: [PATCH] Fixed use after free --- src/glu/sgi/libnurbs/interface/bezierPatch.cc | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/glu/sgi/libnurbs/interface/bezierPatch.cc b/src/glu/sgi/libnurbs/interface/bezierPatch.cc index 836ae94..5b7bda1 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) -- 1.5.2.3