aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--unix/xserver/hw/vnc/xvnc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c
index 042c0a49..80198958 100644
--- a/unix/xserver/hw/vnc/xvnc.c
+++ b/unix/xserver/hw/vnc/xvnc.c
@@ -87,11 +87,6 @@ from the X Consortium.
#endif
#include "site.h"
-#if XORG >= 110
-#define Xalloc malloc
-#define Xfree free
-#endif
-
#define XVNCVERSION "TigerVNC 1.4.80"
#define XVNCCOPYRIGHT ("Copyright (C) 1999-2015 TigerVNC Team and many others (see README.txt)\n" \
"See http://www.tigervnc.org for information on TigerVNC.\n")
@@ -682,6 +677,8 @@ vfbInstallColormap(ColormapPtr pmap)
ppix = (Pixel *)calloc(entries, sizeof(Pixel));
prgb = (xrgb *)calloc(entries, sizeof(xrgb));
defs = (xColorItem *)calloc(entries, sizeof(xColorItem));
+ if (!ppix || !prgb || !defs)
+ FatalError ("Not enough memory for color map\n");
for (i = 0; i < entries; i++) ppix[i] = i;
/* XXX truecolor */
@@ -786,7 +783,7 @@ vfbAllocateFramebufferMemory(vfbFramebufferInfoPtr pfb)
break;
#endif
case NORMAL_MEMORY_FB:
- pfb->pfbMemory = Xalloc(pfb->sizeInBytes);
+ pfb->pfbMemory = malloc(pfb->sizeInBytes);
break;
}
@@ -813,7 +810,7 @@ vfbFreeFramebufferMemory(vfbFramebufferInfoPtr pfb)
break;
#endif /* HAS_SHM */
case NORMAL_MEMORY_FB:
- Xfree(pfb->pfbMemory);
+ free(pfb->pfbMemory);
break;
}