Mesa (mesa_7_7_branch): progs/xdemos: Fix memory leak in glxinfo.c.

Vinson Lee vlee at kemper.freedesktop.org
Fri Nov 20 21:01:57 UTC 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Fri Nov 20 13:01:22 2009 -0800

progs/xdemos: Fix memory leak in glxinfo.c.

---

 progs/xdemos/glxinfo.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c
index 445d3ea..c1a0328 100644
--- a/progs/xdemos/glxinfo.c
+++ b/progs/xdemos/glxinfo.c
@@ -964,8 +964,10 @@ print_fbconfig_info(Display *dpy, int scrnum, InfoMode mode)
    /* get list of all fbconfigs on this screen */
    fbconfigs = glXGetFBConfigs(dpy, scrnum, &numFBConfigs);
 
-   if (numFBConfigs == 0)
+   if (numFBConfigs == 0) {
+      XFree(fbconfigs);
       return;
+   }
 
    printf("%d GLXFBConfigs:\n", numFBConfigs);
    if (mode == Normal)




More information about the mesa-commit mailing list