summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-05-15 15:49:14 -0600
committerIan Romanick <[email protected]>2014-05-16 23:46:34 -0700
commit4baf6f12a528a2baa37b065f8e980d362d14d0cc (patch)
tree2c6ac7bf4321f51ae428b0983c92d9c81b5d807b
parent21792665c7923ca9e3c879727bbc7cfef4ca2582 (diff)
mesa: fix double-freeing of dispatch tables inside glBegin/End.
We allocate dispatch tables for BeginEnd and OutsideBeginEnd. But when we destroy the context we were freeing the BeginEnd and Exec tables. If Exec==BeginEnd we did a double-free. This would happen if the context was destroyed while inside a glBegin/End pair. Now free the BeginEnd and OutsideBeginEnd pointers. Cc: "10.1", "10.2" <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> (cherry picked from commit ef6b6658f91bd5871739bdb71a08042f26abe389)
-rw-r--r--src/mesa/main/context.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 860ae860531..8eb426d5904 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1141,7 +1141,7 @@ _mesa_initialize_context(struct gl_context *ctx,
fail:
_mesa_reference_shared_state(ctx, &ctx->Shared, NULL);
free(ctx->BeginEnd);
- free(ctx->Exec);
+ free(ctx->OutsideBeginEnd);
free(ctx->Save);
return GL_FALSE;
}
@@ -1242,7 +1242,7 @@ _mesa_free_context_data( struct gl_context *ctx )
/* free dispatch tables */
free(ctx->BeginEnd);
- free(ctx->Exec);
+ free(ctx->OutsideBeginEnd);
free(ctx->Save);
/* Shared context state (display lists, textures, etc) */