i915: Don't free the intel_context structure when intelCreateContext fails.
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 27 Sep 2012 00:57:01 +0000 (17:57 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 28 Sep 2012 22:05:24 +0000 (15:05 -0700)
intelDestroyContext will eventually be called, and it will clean things up.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618

src/mesa/drivers/dri/i915/i915_context.c

index 8ae1e580ed63a2d7df8e06df8b81510b23ae983e..c0d1f93bece24a77ada983096b04e668b8a04d1c 100644 (file)
@@ -167,7 +167,6 @@ i915CreateContext(int api,
 
    if (!intelInitContext(intel, api, mesaVis, driContextPriv,
                          sharedContextPrivate, &functions)) {
-      free(i915);
       *error = __DRI_CTX_ERROR_NO_MEMORY;
       return false;
    }
@@ -184,7 +183,6 @@ i915CreateContext(int api,
 
       if (req_version > max_version) {
          *error = __DRI_CTX_ERROR_BAD_VERSION;
-         free(i915);
          return false;
       }
       break;
@@ -194,7 +192,6 @@ i915CreateContext(int api,
       break;
    default:
       *error = __DRI_CTX_ERROR_BAD_API;
-      free(i915);
       return false;
    }