dri3: Fix two little memory leaks.
authorEric Anholt <eric@anholt.net>
Thu, 23 Jan 2014 18:25:58 +0000 (10:25 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 27 Jan 2014 17:36:24 +0000 (09:36 -0800)
Noticed when valgrinding an unrelated bug.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/glx/dri3_glx.c

index 9068ff9426833391ec9011167091e2bb76573f55..3e829651c0568520ce5e5d2d6082522c3dafb2dd 100644 (file)
@@ -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;