aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Display.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Display.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Display.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c
index 659355501..89d49edf1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Display.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c
@@ -2576,12 +2576,18 @@ Bool nxagentReconnectDisplay(void *p0)
nxagentNumDefaultColormaps = nxagentNumVisuals;
- nxagentDefaultColormaps = (Colormap *) realloc(nxagentDefaultColormaps,
- nxagentNumDefaultColormaps * sizeof(Colormap));
-
- if (nxagentDefaultColormaps == NULL)
{
- FatalError("Can't allocate memory for the default colormaps\n");
+ Colormap * tmp = (Colormap *) realloc(nxagentDefaultColormaps,
+ nxagentNumDefaultColormaps * sizeof(Colormap));
+ if (tmp == NULL)
+ {
+ SAFE_free(nxagentDefaultColormaps);
+ FatalError("Can't allocate memory for the default colormaps\n");
+ }
+ else
+ {
+ nxagentDefaultColormaps = tmp;
+ }
}
reconnectDisplayState = ALLOC_DEF_COLORMAP;