[PATCH xf86-video-vesa 3/4] Use VBEFreeVBEInfo not free

Adam Jackson ajax at redhat.com
Wed Jan 31 15:48:08 UTC 2018


A VbeInfoBlock has substructure, just freeing the object will leak.
Unfortunately VBEFreeVBEInfo does not check for NULL first so we have
to.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=25029
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 src/vesa.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/vesa.c b/src/vesa.c
index 3f5b81c..2d3c10d 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -596,7 +596,8 @@ VESAFreeRec(ScrnInfoPtr pScrn)
     }
 #endif
     free(pVesa->monitor);
-    free(pVesa->vbeInfo);
+    if (pVesa->vbeInfo)
+	VBEFreeVBEInfo(pVesa->vbeInfo);
     free(pVesa->pal);
     free(pVesa->savedPal);
     free(pVesa->fonts);
-- 
2.14.3



More information about the xorg-devel mailing list