summaryrefslogtreecommitdiff
path: root/src/glu/sgi/libtess
diff options
context:
space:
mode:
authorAdam Jackson <ajax@freedesktop.org>2006-04-06 23:50:44 +0000
committerAdam Jackson <ajax@freedesktop.org>2006-04-06 23:50:44 +0000
commit03593f53e75295ca93bc5cc911094e75c9f38637 (patch)
treeeadc3eb97b977d8cd7101bb2c9fac516a7f0a1f6 /src/glu/sgi/libtess
parent0a605f93dbf85d4d4504885ccc789bce36cd424b (diff)
Coverity #1083: Fix a use after free case.
Diffstat (limited to 'src/glu/sgi/libtess')
-rw-r--r--src/glu/sgi/libtess/dict.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/glu/sgi/libtess/dict.c b/src/glu/sgi/libtess/dict.c
index fac8032ff3..c20f694850 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: 2001/03/17 00:25:41 $ $Revision: 1.1 $
-** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/dict.c,v 1.1 2001/03/17 00:25:41 brianp Exp $
+** $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 $
*/
#include <stddef.h>
@@ -68,9 +68,13 @@ Dict *dictNewDict( void *frame,
void dictDeleteDict( Dict *dict )
{
DictNode *node;
+ int done = 0;
- for( node = dict->head.next; node != &dict->head; node = node->next ) {
+ for( node = dict->head.next; ; node = node->next ) {
+ done = (node == &dict->head);
memFree( node );
+ if (done)
+ break;
}
memFree( dict );
}