mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 08:04:30 +00:00
mi: fix memory leak in miInitVisuals
Free the pointers inside miInitVisuals, so the callers of this function (fboverlay.c and fbscreen.c) don't need to worry with deallocation in the case of failure. 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>
This commit is contained in:
@@ -221,11 +221,7 @@ fbFinishScreenInit(ScreenPtr pScreen,
|
||||
rootdepth = 0;
|
||||
if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
|
||||
&defaultVisual,((unsigned long)1<<(imagebpp-1)), 8))
|
||||
{
|
||||
free(visuals);
|
||||
free(depths);
|
||||
return FALSE;
|
||||
}
|
||||
if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
|
||||
rootdepth, ndepths, depths,
|
||||
defaultVisual, nvisuals, visuals))
|
||||
|
||||
Reference in New Issue
Block a user