From: Vinson Lee Date: Thu, 8 Nov 2012 07:13:38 +0000 (-0800) Subject: svga: Fix memory leak in svga_buffer_transfer_map. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2aa783318dd40d9ba82b541c1af144f3103b0888;p=mesa.git svga: Fix memory leak in svga_buffer_transfer_map. Fixes resource leak defect reported by Coverity. Signed-off-by: Vinson Lee Reviewed-by: Brian Paul --- diff --git a/src/gallium/drivers/svga/svga_resource_buffer.c b/src/gallium/drivers/svga/svga_resource_buffer.c index 87a4a9b7a82..3aa6644a4a3 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer.c +++ b/src/gallium/drivers/svga/svga_resource_buffer.c @@ -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;