From 89d85e8170e38e04790a2c10541dec01fee9afd2 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 12 Dec 2009 21:46:13 -0800 Subject: glut: Prevent potential double free in menuVisualSetup. --- src/glut/glx/glut_menu.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/glut') diff --git a/src/glut/glx/glut_menu.c b/src/glut/glx/glut_menu.c index 4c4a5ae750..d136823c54 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; -- cgit v1.2.3