aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Display.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c
index c8ad891be..bc85d821d 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Display.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c
@@ -1494,8 +1494,13 @@ void nxagentInitVisuals(void)
if (nxagentVisuals != NULL)
{
- nxagentVisuals = (XVisualInfo *) realloc(nxagentVisuals,
- nxagentNumVisuals * sizeof(XVisualInfo));
+ XVisualInfo *new = (XVisualInfo *) realloc(nxagentVisuals,
+ nxagentNumVisuals * sizeof(XVisualInfo));
+ /* nxagentVisuals being NULL is covered below */
+ if (new)
+ nxagentVisuals = new;
+ else
+ SAFE_free(nxagentVisuals);
}
SAFE_XFree(viList);