[PATCH 6/8] xf8CrtcSetModeTransform: free adjusted_mode name too

Keith Packard keithp at keithp.com
Thu Sep 17 18:14:36 PDT 2009


The adjusted mode was freed, but any name allocated for that was leaked.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 hw/xfree86/modes/xf86Crtc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 8d636af..c6dfd8c 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -384,7 +384,9 @@ done:
 	crtc->transformPresent = saved_transform_present;
     }
 
-    free(adjusted_mode);
+    if (adjusted_mode->name)
+	    xfree(adjusted_mode->name);
+    xfree(adjusted_mode);
 
     if (didLock)
 	crtc->funcs->unlock (crtc);
-- 
1.6.3.3



More information about the xorg-devel mailing list