xserver: Branch 'master'

Maarten Maathuis madman2003 at kemper.freedesktop.org
Thu Dec 18 07:12:29 PST 2008


 hw/xfree86/modes/xf86Crtc.c |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 1b244feb4cf11d1cdba79fbead50035965535552
Author: Maarten Maathuis <madman2003 at gmail.com>
Date:   Thu Dec 18 16:11:21 2008 +0100

    randr: check for malloc failure

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index c710b06..309eb99 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -120,6 +120,10 @@ xf86CrtcCreate (ScrnInfoPtr		scrn,
     /* Preallocate gamma at a sensible size. */
     crtc->gamma_size = 256;
     crtc->gamma_red = malloc(3 * crtc->gamma_size * sizeof (CARD16));
+    if (!crtc->gamma_red) {
+	xfree (crtc);
+	return NULL;
+    }
     crtc->gamma_green = crtc->gamma_red + crtc->gamma_size;
     crtc->gamma_blue = crtc->gamma_green + crtc->gamma_size;
 


More information about the xorg-commit mailing list