summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2011-03-25 22:10:55 +0200
committerTiago Vignatti <tiago.vignatti@nokia.com>2011-04-04 15:41:13 +0300
commit2aa935bc5cc1e2d5365a97b8c5bb3d33eb5fc758 (patch)
tree9be88575cee311ee03e192a2c4690fc47cce43f6
parent4d87606a0d0eb63458098028c300c39c6f1bd2bf (diff)
fb: fix memory leak in fbOverlayFinishScreenInit
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--fb/fboverlay.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fb/fboverlay.c b/fb/fboverlay.c
index 61eaaa3f9..255cc23c1 100644
--- a/fb/fboverlay.c
+++ b/fb/fboverlay.c
@@ -384,12 +384,16 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &depth1,
&defaultVisual, ((unsigned long)1<<(bpp1-1)) |
- ((unsigned long)1<<(bpp2-1)), 8))
+ ((unsigned long)1<<(bpp2-1)), 8)) {
+ free(pScrPriv);
return FALSE;
+ }
if (! miScreenInit(pScreen, 0, xsize, ysize, dpix, dpiy, 0,
depth1, ndepths, depths,
- defaultVisual, nvisuals, visuals))
+ defaultVisual, nvisuals, visuals)) {
+ free(pScrPriv);
return FALSE;
+ }
/* MI thinks there's no frame buffer */
#ifdef MITSHM
ShmRegisterFbFuncs(pScreen);