aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nx-X11/programs/Xserver/dix/dispatch.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c
index 6b6dbcad9..d656da748 100644
--- a/nx-X11/programs/Xserver/dix/dispatch.c
+++ b/nx-X11/programs/Xserver/dix/dispatch.c
@@ -4150,7 +4150,10 @@ AddScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ ,
pScreen->devPrivates = (DevUnion *)calloc(sizeof(DevUnion),
screenPrivateCount);
if (!pScreen->devPrivates && screenPrivateCount)
+ {
+ free(pScreen);
return -1;
+ }
ret = init_screen(pScreen, i);
if (ret != 0) {