diff options
author | Brian Paul <[email protected]> | 2006-04-19 14:42:01 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-04-19 14:42:01 +0000 |
commit | 53f8b7190eaf84ba549c9d442b24ec0442fa610e (patch) | |
tree | 76674c6ec60f668dfc430800e3d17a2d8c867470 /src/glu/sgi | |
parent | 5beff7c6c125768c9665bde008f2cbb756f6821f (diff) |
fix invalid free() problem (bug 6658)
Diffstat (limited to 'src/glu/sgi')
-rw-r--r-- | src/glu/sgi/libtess/dict.c | 13 |
1 files 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 <stddef.h> @@ -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 ); } |