Mesa (master): dri3: Fix two little memory leaks.

Eric Anholt anholt at kemper.freedesktop.org
Mon Jan 27 17:54:52 UTC 2014


Module: Mesa
Branch: master
Commit: 378e7ad26f11aacd02a131262646e48c362539ef
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=378e7ad26f11aacd02a131262646e48c362539ef

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Jan 23 10:25:58 2014 -0800

dri3: Fix two little memory leaks.

Noticed when valgrinding an unrelated bug.

Reviewed-by: Keith Packard <keithp at keithp.com>
Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

---

 src/glx/dri3_glx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c
index 9068ff9..3e82965 100644
--- a/src/glx/dri3_glx.c
+++ b/src/glx/dri3_glx.c
@@ -1338,14 +1338,13 @@ dri3_open(Display *dpy,
    xcb_dri3_open_cookie_t       cookie;
    xcb_dri3_open_reply_t        *reply;
    xcb_connection_t             *c = XGetXCBConnection(dpy);
-   xcb_generic_error_t          *error;
    int                          fd;
 
    cookie = xcb_dri3_open(c,
                           root,
                           provider);
 
-   reply = xcb_dri3_open_reply(c, cookie, &error);
+   reply = xcb_dri3_open_reply(c, cookie, NULL);
    if (!reply)
       return -1;
 
@@ -1799,6 +1798,7 @@ dri3_create_display(Display * dpy)
    }
    pdp->presentMajor = present_reply->major_version;
    pdp->presentMinor = present_reply->minor_version;
+   free(present_reply);
 
    pdp->base.destroyDisplay = dri3_destroy_display;
    pdp->base.createScreen = dri3_create_screen;




More information about the mesa-commit mailing list