projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1781d26
)
mesa/st: Fix derreference after free.
author
José Fonseca
<jfonseca@vmware.com>
Wed, 25 Apr 2012 10:41:13 +0000
(11:41 +0100)
committer
José Fonseca
<jfonseca@vmware.com>
Wed, 25 Apr 2012 10:41:13 +0000
(11:41 +0100)
src/mesa/state_tracker/st_context.c
patch
|
blob
|
history
diff --git
a/src/mesa/state_tracker/st_context.c
b/src/mesa/state_tracker/st_context.c
index 84aae8144167e7bd71f3168947ef365245425860..19d9da131f3f7018114411842f5ec27af6ddaeca 100644
(file)
--- a/
src/mesa/state_tracker/st_context.c
+++ b/
src/mesa/state_tracker/st_context.c
@@
-270,6
+270,7
@@
static void st_destroy_context_priv( struct st_context *st )
void st_destroy_context( struct st_context *st )
{
struct pipe_context *pipe = st->pipe;
+ struct u_vbuf *vbuf = st->vbuf;
struct cso_context *cso = st->cso_context;
struct gl_context *ctx = st->ctx;
GLuint i;
@@
-300,10
+301,13
@@
void st_destroy_context( struct st_context *st )
_mesa_free_context_data(ctx);
+ /* This will free the st_context too, so 'st' must not be accessed
+ * afterwards. */
st_destroy_context_priv(st);
+ st = NULL;
- if (
st->
vbuf)
- u_vbuf_destroy(
st->
vbuf);
+ if (vbuf)
+ u_vbuf_destroy(vbuf);
cso_destroy_context(cso);