diff options
author | Mike Gorchak <mike.gorchak.qnx@gmail.com> | 2013-01-02 13:39:50 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2013-01-02 13:50:44 -0700 |
commit | bfdf99d6ff64b9c2d840e8a5767eaa57e4363c79 (patch) | |
tree | e298b1b45d850522d2c91f3a75b9654ebe82883c | |
parent | 030651b64854b84a01ebebad9af188e7644c541a (diff) |
glu: initialize PriorityQ::order field to NULL in pqNewPriorityQ()
pqNewPriorityQ() function creates and setups PriorityQ structure, all
except for the field "order". It is filled later in function
pqInit(). Depending on vertices of polygon which must be tesselated
there possible following situation, pqDeletePriorityQ() is called
right after pqNewPriorityQ() function. pqNewPriorityQ() tries to free
memory using pq->order as pointer, which is unitialized at this point.
Signed-off-by: Brian Paul <brianp@vmware.com>
-rw-r--r-- | src/libtess/priorityq.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libtess/priorityq.c b/src/libtess/priorityq.c index c6b99cc..db7cd59 100644 --- a/src/libtess/priorityq.c +++ b/src/libtess/priorityq.c @@ -65,6 +65,7 @@ PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ) return NULL; } + pq->order = NULL; pq->size = 0; pq->max = INIT_SIZE; pq->initialized = FALSE; |