From 85e8518116fc3fa9a30d6b492280dd42354240b8 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 31 Aug 2012 14:55:21 -0700 Subject: [PATCH] i965: Don't leave dangling pointer to brw context on failure Otherwise intelDestroyContext would try to dereference the pointer to freed memory. NOTE: This is a candidate for the 9.0 branch. Signed-off-by: Ian Romanick Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301 --- src/mesa/drivers/dri/i965/brw_context.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 4e5aed6..ab485c3 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -149,6 +149,7 @@ brwCreateContext(int api, sharedContextPrivate, &functions )) { printf("%s: failed to init intel context\n", __FUNCTION__); FREE(brw); + driContextPriv->driverPrivate = NULL; *error = __DRI_CTX_ERROR_NO_MEMORY; return false; } -- 1.7.11.4