svga: Fix memory leak in svga_buffer_transfer_map.
authorVinson Lee <vlee@freedesktop.org>
Thu, 8 Nov 2012 07:13:38 +0000 (23:13 -0800)
committerVinson Lee <vlee@freedesktop.org>
Fri, 9 Nov 2012 05:28:15 +0000 (21:28 -0800)
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/svga/svga_resource_buffer.c

index 87a4a9b7a829677db72c5826a35c102f02f92464..3aa6644a4a3bea7bad506b14f1b3bf01521f19bc 100644 (file)
@@ -206,6 +206,8 @@ svga_buffer_transfer_map(struct pipe_context *pipe,
       ++sbuf->map.count;
       map += transfer->box.x;
       *ptransfer = transfer;
+   } else {
+      FREE(transfer);
    }
    
    return map;