diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-08-27 08:27:42 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-08-27 08:27:42 +0200 |
commit | 6f80a06fb96725e7eadf846bf0e727821aadbf47 (patch) | |
tree | 64846b3be22e28618ffe285db02d55fa5d4de709 /nx-X11/programs/Xserver/hw/nxagent/Colormap.c | |
parent | 8b15d574b49857cdf4df0fd813d68b750d8aee5f (diff) | |
parent | f39b81d31bc7d0427ea9cca04d0e4a21579d7383 (diff) | |
download | nx-libs-6f80a06fb96725e7eadf846bf0e727821aadbf47.tar.gz nx-libs-6f80a06fb96725e7eadf846bf0e727821aadbf47.tar.bz2 nx-libs-6f80a06fb96725e7eadf846bf0e727821aadbf47.zip |
Merge branch 'uli42-pr/safe_free' into 3.6.x
Attributes GH PR #826: https://github.com/ArcticaProject/nx-libs/pull/826
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Colormap.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Colormap.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c index 401f05b94..33b0738ec 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c @@ -54,6 +54,7 @@ is" without express or implied warranty. #include "Visual.h" #include "Windows.h" #include "Args.h" +#include "Utils.h" #define PANIC #define WARNING @@ -120,7 +121,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) pCmap->red[i].co.local.green = colors[i].red; pCmap->red[i].co.local.blue = colors[i].red; } - free(colors); + SAFE_free(colors); break; case StaticColor: /* read only */ @@ -133,7 +134,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) pCmap->red[i].co.local.green = colors[i].green; pCmap->red[i].co.local.blue = colors[i].blue; } - free(colors); + SAFE_free(colors); break; case TrueColor: /* read only */ @@ -157,7 +158,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) pCmap->green[i].co.local.green = colors[i].green; pCmap->blue[i].co.local.blue = colors[i].blue; } - free(colors); + SAFE_free(colors); break; case GrayScale: /* read and write */ @@ -176,7 +177,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) void nxagentDestroyColormap(ColormapPtr pCmap) { XFreeColormap(nxagentDisplay, nxagentColormap(pCmap)); - free(pCmap->devPriv); + SAFE_free(pCmap->devPriv); } #define SEARCH_PREDICATE \ @@ -254,10 +255,10 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) numWindows = 0; } - free(icws.cmapIDs); + SAFE_free(icws.cmapIDs); if (!nxagentSameInstalledColormapWindows(icws.windows, icws.numWindows)) { - free(nxagentOldInstalledColormapWindows); + SAFE_free(nxagentOldInstalledColormapWindows); #ifdef _XSERVER64 { @@ -268,7 +269,7 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) windows[i] = icws.windows[i]; XSetWMColormapWindows(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], windows, numWindows); - free(windows); + SAFE_free(windows); } #else XSetWMColormapWindows(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], @@ -317,12 +318,12 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) #endif /* DUMB_WINDOW_MANAGERS */ } else - free(icws.windows); + SAFE_free(icws.windows); } void nxagentSetScreenSaverColormapWindow(ScreenPtr pScreen) { - free(nxagentOldInstalledColormapWindows); + SAFE_free(nxagentOldInstalledColormapWindows); #ifdef _XSERVER64 { @@ -454,7 +455,7 @@ void nxagentStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors) pColors64[i].flags = pColors[i].flags; } XStoreColors(nxagentDisplay, nxagentColormap(pCmap), pColors64, nColors); - free(pColors64); + SAFE_free(pColors64); } #else XStoreColors(nxagentDisplay, nxagentColormap(pCmap), |