loader: fix memory leak in loader_dri3_open
authorJan Ziak <0xe2.0x9a.0x9b@gmail.com>
Sat, 30 Jul 2016 00:31:10 +0000 (02:31 +0200)
committerEric Anholt <eric@anholt.net>
Wed, 3 Aug 2016 17:25:09 +0000 (10:25 -0700)
Found via "valgrind --leak-check=full glxgears".

Signed-off-by: Jan Ziak (http://atom-symbol.net) <0xe2.0x9a.0x9b@gmail.com>
Acked-by: Boyan Ding <boyan.j.ding@gmail.com>
Cc: "12.0 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/loader/loader_dri3_helper.c

index 896f2252f364a1d6632258871f698217c8919262..67d0c2c2f3a1521112cb160067805ae331a5dd15 100644 (file)
@@ -785,6 +785,7 @@ loader_dri3_open(xcb_connection_t *conn,
    }
 
    fd = xcb_dri3_open_reply_fds(conn, reply)[0];
+   free(reply);
    fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
 
    return fd;