[PATCH xserver 2/4] modesetting: Free output_ids in drmmode_set_mode_major()

Daniel Martin daniel.martin at secunet.com
Thu Oct 29 06:58:10 PDT 2015


From: Daniel Martin <consume.noise at gmail.com>

We calloc() output_ids. Let's free() it, too.

Signed-off-by: Daniel Martin <consume.noise at gmail.com>
---
 hw/xfree86/drivers/modesetting/drmmode_display.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index f86c1f8..2684bae 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -340,7 +340,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
     int saved_x, saved_y;
     Rotation saved_rotation;
     DisplayModeRec saved_mode;
-    uint32_t *output_ids;
+    uint32_t *output_ids = NULL;
     int output_count = 0;
     Bool ret = TRUE;
     int i;
@@ -468,6 +468,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
         crtc->active = TRUE;
 #endif
 
+    free(output_ids);
+
     return ret;
 }
 
-- 
2.6.1



More information about the xorg-devel mailing list