From: Vinson Lee Date: Sun, 13 Dec 2009 05:46:13 +0000 (-0800) Subject: glut: Prevent potential double free in menuVisualSetup. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=89d85e8170e38e04790a2c10541dec01fee9afd2;p=mesa.git glut: Prevent potential double free in menuVisualSetup. --- diff --git a/src/glut/glx/glut_menu.c b/src/glut/glx/glut_menu.c index 4c4a5ae7503..d136823c54f 100644 --- a/src/glut/glx/glut_menu.c +++ b/src/glut/glx/glut_menu.c @@ -225,6 +225,7 @@ menuVisualSetup(void) if (!status) { XFreeColormap(__glutDisplay, menuColormap); free(placeHolders); + placeHolders = NULL; continue; } } @@ -241,6 +242,7 @@ menuVisualSetup(void) XFreeColormap(__glutDisplay, menuColormap); if (placeHolders) { free(placeHolders); + placeHolders = NULL; } continue; } @@ -252,6 +254,7 @@ menuVisualSetup(void) XFreeColormap(__glutDisplay, menuColormap); if (placeHolders) { free(placeHolders); + placeHolders = NULL; } continue; } @@ -263,6 +266,7 @@ menuVisualSetup(void) XFreeColormap(__glutDisplay, menuColormap); if (placeHolders) { free(placeHolders); + placeHolders = NULL; } continue; } @@ -271,6 +275,7 @@ menuVisualSetup(void) XFreeColors(__glutDisplay, menuColormap, placeHolders, numPlaceHolders, 0); free(placeHolders); + placeHolders = NULL; } menuWhite = color.pixel; menuVisual = visual->vinfo.visual;