From da7029dcb498f80d1837323038617b49cc28431f Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 29 Nov 2012 23:10:03 -0800 Subject: [PATCH] radeon: Fix memory leak in radeonCreateScreen2. Fixes a memory leak defect reported by Coverity. Signed-off-by: Vinson Lee Reviewed-by: Brian Paul --- 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 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; -- 2.30.2