[PATCH] modesetting: memory leaks fixes

xurui xurui at kylinos.cn
Mon Dec 19 09:10:59 UTC 2022


A memory leaks fixes

Signed-off-by: xurui <xurui at kylinos.cn>
Change-Id: I2fd7a508336e7202d2ab10e994098cdcedfe260f
---
 hw/xfree86/drivers/modesetting/driver.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index fe3315a9c..5c43a1cb9 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -1007,8 +1007,10 @@ msShouldDoubleShadow(ScrnInfoPtr pScrn, modesettingPtr ms)
     int from;
     drmVersionPtr v = drmGetVersion(ms->fd);
 
-    if (!ms->drmmode.shadow_enable)
+    if (!ms->drmmode.shadow_enable) {
+        drmFreeVersion(v);
         return FALSE;
+    }
 
     if (!strcmp(v->name, "mgag200") ||
         !strcmp(v->name, "ast")) /* XXX || rn50 */
-- 
2.25.1



More information about the xorg-devel mailing list