From d26fae246d7c451b4d5ffe24fdb959d4bd00b107 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Tue, 25 Oct 2011 14:56:35 -0200 Subject: glx: don't leak fbconfigs 29,952 (208 direct, 29,744 indirect) bytes in 1 blocks are definitely lost in loss record 573 of 573 at 0x4C2779D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4829BC: createModeFromConfig (glxdricommon.c:131) by 0x482C09: glxConvertConfigs (glxdricommon.c:185) by 0x482788: __glXDRIscreenProbe (glxdriswrast.c:468) by 0x4812FA: GlxExtensionInit (glxext.c:327) by 0x41FB14: InitExtensions (miinitext.c:471) by 0x568636: main (main.c:208) Signed-off-by: Paulo Zanoni Reviewed-by: Jeremy Huddleston --- glx/glxscreens.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'glx') diff --git a/glx/glxscreens.c b/glx/glxscreens.c index ebb9747b4..928cf0c92 100644 --- a/glx/glxscreens.c +++ b/glx/glxscreens.c @@ -419,6 +419,15 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen) void __glXScreenDestroy(__GLXscreen *screen) { + __GLXconfig *head, *next; + + head = screen->fbconfigs; + while (head) { + next = head->next; + free(head); + head = next; + } + free(screen->GLXvendor); free(screen->GLXextensions); free(screen->GLextensions); -- cgit v1.2.3