main: create_buffers unlocks mutex when throwing OUT_OF_MEMORY.
authorLaura Ekstrand <laura@jlekstrand.net>
Wed, 1 Apr 2015 18:18:32 +0000 (11:18 -0700)
committerLaura Ekstrand <laura@jlekstrand.net>
Wed, 1 Apr 2015 19:07:28 +0000 (12:07 -0700)
Ilia Mirkin found that I had forgotten to free the mutex in the error case.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/main/bufferobj.c

index c45cec405a0375497e6f9602b847c643bedab7dd..66dee680258bc4fd68b756c414f81bb8a7ceb545 100644 (file)
@@ -1333,6 +1333,7 @@ create_buffers(GLsizei n, GLuint *buffers, bool dsa)
          buf = ctx->Driver.NewBufferObject(ctx, buffers[i]);
          if (!buf) {
             _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
+            mtx_unlock(&ctx->Shared->Mutex);
             return;
          }
       }