[PATCH 2/5] fb: fbFinishScreenInit: leaked_storage: Variable "(visuals|depths)" goes out of scope

Oliver McFadden oliver.mcfadden at nokia.com
Mon Mar 15 14:46:34 PDT 2010


Signed-off-by: Oliver McFadden <oliver.mcfadden at nokia.com>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
---
 fb/fbscreen.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fb/fbscreen.c b/fb/fbscreen.c
index 24eadde..53e2ada 100644
--- a/fb/fbscreen.c
+++ b/fb/fbscreen.c
@@ -228,7 +228,11 @@ fbFinishScreenInit(ScreenPtr	pScreen,
     rootdepth = 0;
     if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
 			&defaultVisual,((unsigned long)1<<(imagebpp-1)), 8))
+    {
+	xfree (visuals);
+	xfree (depths);
 	return FALSE;
+    }
     if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
 			rootdepth, ndepths, depths,
 			defaultVisual, nvisuals, visuals))
-- 
1.6.1



More information about the xorg-devel mailing list