[Mesa-dev] [PATCH] radeon: Fix memory leak in radeonCreateScreen2.
Brian Paul
brianp at vmware.com
Fri Nov 30 07:19:20 PST 2012
On 11/30/2012 12:25 AM, Vinson Lee wrote:
> Fixes a memory leak defect reported by Coverity.
>
> Signed-off-by: Vinson Lee<vlee at freedesktop.org>
> ---
> src/mesa/drivers/dri/radeon/radeon_screen.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
> index 6f4750a..2e6cf3c 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_screen.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
> @@ -510,8 +510,10 @@ radeonCreateScreen2(__DRIscreen *sPriv)
> }
>
> ret = radeon_set_screen_flags(screen, device_id);
> - if (ret == -1)
> + if (ret == -1) {
> + free(screen);
> return NULL;
> + }
>
> if (getenv("RADEON_NO_TCL"))
> screen->chip_flags&= ~RADEON_CHIPSET_TCL;
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list