loader: free error state, when checking the drawable type
authorKirill Burtsev <kirill.burtsev@qt.io>
Wed, 5 Dec 2018 15:54:27 +0000 (15:54 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 10 Dec 2018 16:19:55 +0000 (16:19 +0000)
Currently we distinguish if the drawable is a window or pixmap by
checking xcb_present_select_input throws an error or not.

Yet, we don't always free the error state returned by xcb.

Cc: Kirill Burtsev <kirill.burtsev@qt.io>
Cc: Boyan Ding <boyan.j.ding@gmail.com>
Fixes: 6bd9ba7d074 ("loader: Add dri3 helper")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
[Emil: add commit message, fixes tag]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/loader/loader_dri3_helper.c

index 1981b5f05151765a1c8991ba9fd51349e2962c56..7cd6b1e8ab66d7ed8db5994bd4958ad3a656af41 100644 (file)
@@ -1509,6 +1509,7 @@ dri3_update_drawable(struct loader_dri3_drawable *draw)
             mtx_unlock(&draw->mtx);
             return false;
          }
+         free(error);
          draw->is_pixmap = true;
          xcb_unregister_for_special_event(draw->conn, draw->special_event);
          draw->special_event = NULL;