[PATCH xserver/hw/xfree86/modes/xf86Crtc.c] memory leak

vdb at picaros.org vdb at picaros.org
Tue Aug 30 22:17:50 PDT 2011


This tiny patch fixes a memory leak in xf86CrtcCreate().

Signed-off-by: Servaas Vandenberghe
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index c2814d4..74c8d66 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -133,6 +133,7 @@ xf86CrtcCreate (ScrnInfoPtr		scrn,
 	crtcs = malloc((xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr));
     if (!crtcs)
     {
+	free(crtc->gamma_red);
 	free(crtc);
 	return NULL;
     }


More information about the xorg-devel mailing list