From 53f8b7190eaf84ba549c9d442b24ec0442fa610e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 19 Apr 2006 14:42:01 +0000 Subject: [PATCH] fix invalid free() problem (bug 6658) --- src/glu/sgi/libtess/dict.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/glu/sgi/libtess/dict.c b/src/glu/sgi/libtess/dict.c index c20f6948502..e3750eea225 100644 --- a/src/glu/sgi/libtess/dict.c +++ b/src/glu/sgi/libtess/dict.c @@ -35,8 +35,8 @@ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2006/04/06 23:50:44 $ $Revision: 1.2 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/dict.c,v 1.2 2006/04/06 23:50:44 ajax Exp $ +** $Date: 2006/04/19 14:42:01 $ $Revision: 1.3 $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/dict.c,v 1.3 2006/04/19 14:42:01 brianp Exp $ */ #include @@ -67,14 +67,11 @@ Dict *dictNewDict( void *frame, /* really __gl_dictListDeleteDict */ void dictDeleteDict( Dict *dict ) { - DictNode *node; - int done = 0; + DictNode *node, *next; - for( node = dict->head.next; ; node = node->next ) { - done = (node == &dict->head); + for( node = dict->head.next; node != &dict->head; node = next ) { + next = node->next; memFree( node ); - if (done) - break; } memFree( dict ); } -- 2.30.2