vbo: avoid leaking prim on vbo bind failure
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 1 May 2016 02:29:17 +0000 (22:29 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 1 May 2016 15:19:08 +0000 (11:19 -0400)
Spotted by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Vinson Lee <vlee@freedesktop.org>
src/mesa/vbo/vbo_exec_array.c

index 2d35f5a43ac3f73d98458ed2d1bee28e6eb61075..3b45eb5d09fbfa37da575d6b35887c43f989828e 100644 (file)
@@ -1138,8 +1138,10 @@ vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
       return;
    }
 
-   if (!vbo_bind_arrays(ctx))
+   if (!vbo_bind_arrays(ctx)) {
+      free(prim);
       return;
+   }
 
    min_index_ptr = (uintptr_t)indices[0];
    max_index_ptr = 0;