[Mesa-dev] [PATCH] svga: Fix memory leak in svga_buffer_transfer_map.
Brian Paul
brianp at vmware.com
Thu Nov 8 06:48:01 PST 2012
On 11/08/2012 12:26 AM, Vinson Lee wrote:
> Fixes resource leak defect reported by Coverity.
>
> Signed-off-by: Vinson Lee<vlee at freedesktop.org>
> ---
> src/gallium/drivers/svga/svga_resource_buffer.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/gallium/drivers/svga/svga_resource_buffer.c b/src/gallium/drivers/svga/svga_resource_buffer.c
> index 87a4a9b..3aa6644 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;
Reviewed-by: Brian Paul <brianp at vmware.com>
I actually fixed this a couple weeks ago in-house but didn't propagate
it out yet. Thanks.
-Brina
More information about the mesa-dev
mailing list