aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86fbman.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86fbman.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86fbman.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86fbman.c b/xorg-server/hw/xfree86/common/xf86fbman.c
index c2e7bab9f..4da6af2b6 100644
--- a/xorg-server/hw/xfree86/common/xf86fbman.c
+++ b/xorg-server/hw/xfree86/common/xf86fbman.c
@@ -320,15 +320,17 @@ localRegisterFreeBoxCallback(ScreenPtr pScreen,
newCallbacks = realloc(offman->FreeBoxesUpdateCallback,
sizeof(FreeBoxCallbackProcPtr) *
(offman->NumCallbacks + 1));
+ if (!newCallbacks)
+ return FALSE;
+ else
+ offman->FreeBoxesUpdateCallback = newCallbacks;
newPrivates = realloc(offman->devPrivates,
sizeof(DevUnion) * (offman->NumCallbacks + 1));
-
- if (!newCallbacks || !newPrivates)
+ if (!newPrivates)
return FALSE;
-
- offman->FreeBoxesUpdateCallback = newCallbacks;
- offman->devPrivates = newPrivates;
+ else
+ offman->devPrivates = newPrivates;
offman->FreeBoxesUpdateCallback[offman->NumCallbacks] = FreeBoxCallback;
offman->devPrivates[offman->NumCallbacks].ptr = devPriv;