mesa: Fix memory leak in out-of-memory path.
authorVinson Lee <vlee@vmware.com>
Mon, 24 Oct 2011 18:57:15 +0000 (11:57 -0700)
committerVinson Lee <vlee@vmware.com>
Mon, 24 Oct 2011 21:13:01 +0000 (14:13 -0700)
Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/pack.c

index 092e541c5db32ca793f44e859ee0ffa998dee4de..ecdeaf5dccfa8c697c7482b504b0187bc9681397 100644 (file)
@@ -3717,6 +3717,7 @@ _mesa_unpack_color_span_ubyte(struct gl_context *ctx,
 
          if (!indexes) {
             _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
+            free(rgba);
             return;
          }