Commit 43e300ec authored by Ulrich Sibiller's avatar Ulrich Sibiller

Colormap.c: use SAFE_free

parent 633d0409
...@@ -54,6 +54,7 @@ is" without express or implied warranty. ...@@ -54,6 +54,7 @@ is" without express or implied warranty.
#include "Visual.h" #include "Visual.h"
#include "Windows.h" #include "Windows.h"
#include "Args.h" #include "Args.h"
#include "Utils.h"
#define PANIC #define PANIC
#define WARNING #define WARNING
...@@ -120,7 +121,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) ...@@ -120,7 +121,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
pCmap->red[i].co.local.green = colors[i].red; pCmap->red[i].co.local.green = colors[i].red;
pCmap->red[i].co.local.blue = colors[i].red; pCmap->red[i].co.local.blue = colors[i].red;
} }
free(colors); SAFE_free(colors);
break; break;
case StaticColor: /* read only */ case StaticColor: /* read only */
...@@ -133,7 +134,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) ...@@ -133,7 +134,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
pCmap->red[i].co.local.green = colors[i].green; pCmap->red[i].co.local.green = colors[i].green;
pCmap->red[i].co.local.blue = colors[i].blue; pCmap->red[i].co.local.blue = colors[i].blue;
} }
free(colors); SAFE_free(colors);
break; break;
case TrueColor: /* read only */ case TrueColor: /* read only */
...@@ -157,7 +158,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) ...@@ -157,7 +158,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
pCmap->green[i].co.local.green = colors[i].green; pCmap->green[i].co.local.green = colors[i].green;
pCmap->blue[i].co.local.blue = colors[i].blue; pCmap->blue[i].co.local.blue = colors[i].blue;
} }
free(colors); SAFE_free(colors);
break; break;
case GrayScale: /* read and write */ case GrayScale: /* read and write */
...@@ -176,7 +177,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) ...@@ -176,7 +177,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
void nxagentDestroyColormap(ColormapPtr pCmap) void nxagentDestroyColormap(ColormapPtr pCmap)
{ {
XFreeColormap(nxagentDisplay, nxagentColormap(pCmap)); XFreeColormap(nxagentDisplay, nxagentColormap(pCmap));
free(pCmap->devPriv); SAFE_free(pCmap->devPriv);
} }
#define SEARCH_PREDICATE \ #define SEARCH_PREDICATE \
...@@ -254,10 +255,10 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) ...@@ -254,10 +255,10 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
numWindows = 0; numWindows = 0;
} }
free(icws.cmapIDs); SAFE_free(icws.cmapIDs);
if (!nxagentSameInstalledColormapWindows(icws.windows, icws.numWindows)) { if (!nxagentSameInstalledColormapWindows(icws.windows, icws.numWindows)) {
free(nxagentOldInstalledColormapWindows); SAFE_free(nxagentOldInstalledColormapWindows);
#ifdef _XSERVER64 #ifdef _XSERVER64
{ {
...@@ -268,7 +269,7 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) ...@@ -268,7 +269,7 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
windows[i] = icws.windows[i]; windows[i] = icws.windows[i];
XSetWMColormapWindows(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], XSetWMColormapWindows(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum],
windows, numWindows); windows, numWindows);
free(windows); SAFE_free(windows);
} }
#else #else
XSetWMColormapWindows(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], XSetWMColormapWindows(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum],
...@@ -317,12 +318,12 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) ...@@ -317,12 +318,12 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
#endif /* DUMB_WINDOW_MANAGERS */ #endif /* DUMB_WINDOW_MANAGERS */
} }
else else
free(icws.windows); SAFE_free(icws.windows);
} }
void nxagentSetScreenSaverColormapWindow(ScreenPtr pScreen) void nxagentSetScreenSaverColormapWindow(ScreenPtr pScreen)
{ {
free(nxagentOldInstalledColormapWindows); SAFE_free(nxagentOldInstalledColormapWindows);
#ifdef _XSERVER64 #ifdef _XSERVER64
{ {
...@@ -454,7 +455,7 @@ void nxagentStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors) ...@@ -454,7 +455,7 @@ void nxagentStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors)
pColors64[i].flags = pColors[i].flags; pColors64[i].flags = pColors[i].flags;
} }
XStoreColors(nxagentDisplay, nxagentColormap(pCmap), pColors64, nColors); XStoreColors(nxagentDisplay, nxagentColormap(pCmap), pColors64, nColors);
free(pColors64); SAFE_free(pColors64);
} }
#else #else
XStoreColors(nxagentDisplay, nxagentColormap(pCmap), XStoreColors(nxagentDisplay, nxagentColormap(pCmap),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment