From: Brian Paul Date: Tue, 16 Sep 2008 14:49:43 +0000 (-0600) Subject: mesa: protect against double-free in _vbo_DestroyContext() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4992806ae54d7d1db86eed9c6524aa05f4a2fbd6;p=mesa.git mesa: protect against double-free in _vbo_DestroyContext() --- diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index dc7c534251e..b452ac8a38e 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; + } }