From: Vinson Lee Date: Fri, 30 Nov 2012 07:10:03 +0000 (-0800) Subject: radeon: Fix memory leak in radeonCreateScreen2. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=da7029dcb498f80d1837323038617b49cc28431f;p=mesa.git radeon: Fix memory leak in radeonCreateScreen2. Fixes a memory leak defect reported by Coverity. Signed-off-by: Vinson Lee Reviewed-by: Brian Paul --- diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 6f4750a02ff..2e6cf3cb5c0 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;