From 4992806ae54d7d1db86eed9c6524aa05f4a2fbd6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 16 Sep 2008 08:49:43 -0600 Subject: mesa: protect against double-free in _vbo_DestroyContext() --- src/mesa/vbo/vbo_context.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mesa/vbo/vbo_context.c') diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index dc7c534251..b452ac8a38 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -246,12 +246,14 @@ void _vbo_DestroyContext( GLcontext *ctx ) ctx->aelt_context = NULL; } - vbo_exec_destroy(ctx); + if (vbo_context(ctx)) { + vbo_exec_destroy(ctx); #if FEATURE_dlist - vbo_save_destroy(ctx); + vbo_save_destroy(ctx); #endif - FREE(vbo_context(ctx)); - ctx->swtnl_im = NULL; + FREE(vbo_context(ctx)); + ctx->swtnl_im = NULL; + } } -- cgit v1.2.3