Module: Mesa
Branch: master
Commit: b0eada1707f0b7b4346663b98a7fb1a803580327
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b0eada1707f0b7b4346663b98a7fb1a803580327

Author: Emil Velikov <emil.l.veli...@gmail.com>
Date:   Thu Jan 22 17:35:40 2015 +0000

glx: do not leak the dri2 extension information

The XExtensionInfo is allocated dynamically (if the pointer is NULL)
in the XEXT_GENERATE_FIND_DISPLAY macro. On the other hand the
macro XEXT_GENERATE_CLOSE_DISPLAY does not check/free the memory.

Follow the example set by dri1 and appledri, and use a static variable.

Spotted while hunting "still reachable" leaks in Waffle.

Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com>

---

 src/glx/dri2.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/glx/dri2.c b/src/glx/dri2.c
index cc6c164..9ebd00a 100644
--- a/src/glx/dri2.c
+++ b/src/glx/dri2.c
@@ -53,7 +53,8 @@
 
 
 static char dri2ExtensionName[] = DRI2_NAME;
-static XExtensionInfo *dri2Info;
+static XExtensionInfo _dri2Info_data;
+static XExtensionInfo *dri2Info = &_dri2Info_data;
 static XEXT_GENERATE_CLOSE_DISPLAY (DRI2CloseDisplay, dri2Info)
 
 static Bool

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to