From 8c5ff2e93f73b24adff741b25fc1e31b2f5dd0ac Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 10 Feb 2013 10:24:59 -0800 Subject: [PATCH] __glXDRIscreenProbe: free screen when DRI2Connect fails, instead of leaking it Reported with other leaks found by cppcheck in bugzilla #50281 https://bugs.freedesktop.org/show_bug.cgi?id=50281 V2: goto existing error handler, instead of replicating more of it here Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard --- glx/glxdri2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glx/glxdri2.c b/glx/glxdri2.c index e07cb5632..65485793b 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -946,7 +946,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) &screen->fd, &driverName, &deviceName)) { LogMessage(X_INFO, "AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum); - return NULL; + goto handle_error; } screen->base.destroy = __glXDRIscreenDestroy;