[PATCH 2/5] __glXDRIscreenProbe: free screen when DRI2Connect fails, instead of leaking it

Alan Coopersmith alan.coopersmith at oracle.com
Sun Feb 10 12:39:33 PST 2013


Reported with other leaks found by cppcheck in bugzilla #50281
https://bugs.freedesktop.org/show_bug.cgi?id=50281

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 glx/glxdri2.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index b26e501..e014529 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -939,6 +939,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
                      &screen->fd, &driverName, &deviceName)) {
         LogMessage(X_INFO,
                    "AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum);
+        free(screen);
         return NULL;
     }
 
-- 
1.7.9.2



More information about the xorg-devel mailing list