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

Vinson Lee vlee at kemper.freedesktop.org
Thu Dec 3 23:59:30 PST 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: 7324c22024297d1307f511ee320ebdfd47926228
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7324c22024297d1307f511ee320ebdfd47926228

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

progs/xdemos: Fix memory leak in glxinfo.c.
(cherry picked from commit f080567f4c4018c4885c105a154cb0eb39e6234f)

---

 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