diff options
author | Adam Jackson <ajax@freedesktop.org> | 2006-04-06 23:50:44 +0000 |
---|---|---|
committer | Adam Jackson <ajax@freedesktop.org> | 2006-04-06 23:50:44 +0000 |
commit | 03593f53e75295ca93bc5cc911094e75c9f38637 (patch) | |
tree | eadc3eb97b977d8cd7101bb2c9fac516a7f0a1f6 /src | |
parent | 0a605f93dbf85d4d4504885ccc789bce36cd424b (diff) |
Coverity #1083: Fix a use after free case.
Diffstat (limited to 'src')
-rw-r--r-- | src/glu/sgi/libtess/dict.c | 10 |
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 ); } |