aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Atoms.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
index 2daad061e..61953e2a6 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
@@ -385,12 +385,16 @@ static void nxagentExpandCache(void)
{
privAtomMapSize += NXAGENT_ATOM_MAP_SIZE_INCREMENT;
- privAtomMap = realloc(privAtomMap, privAtomMapSize * sizeof(AtomMap));
+ AtomMap * newmap = realloc(privAtomMap, privAtomMapSize * sizeof(AtomMap));
- if (privAtomMap == NULL)
+ if (newmap == NULL)
{
FatalError("nxagentExpandCache: realloc failed\n");
}
+ else
+ {
+ privAtomMap = newmap;
+ }
}
/*