]> git.sur5r.net Git - i3/i3/commitdiff
Fix memleaks by avoiding _checked variants when discarding the result
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 14 Sep 2016 07:22:06 +0000 (09:22 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 14 Sep 2016 07:22:45 +0000 (09:22 +0200)
Thanks psychon for pointing this out in
https://github.com/i3/i3/pull/2450#discussion_r78560433!

src/main.c
src/x.c

index 367ebac16688ede9b8132138eed3dc389efb9491..5362d0775e53c175b96619a5dbfd93c74f0fcaf9 100644 (file)
@@ -826,7 +826,7 @@ int main(int argc, char *argv[]) {
                       (uint32_t[]){XCB_GX_COPY, ~0, XCB_FILL_STYLE_SOLID, XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS});
 
         xcb_copy_area(conn, root->root, pixmap, gc, 0, 0, 0, 0, width, height);
-        xcb_change_window_attributes_checked(conn, root->root, XCB_CW_BACK_PIXMAP, (uint32_t[]){pixmap});
+        xcb_change_window_attributes(conn, root->root, XCB_CW_BACK_PIXMAP, (uint32_t[]){pixmap});
         xcb_flush(conn);
         xcb_free_gc(conn, gc);
         xcb_free_pixmap(conn, pixmap);
diff --git a/src/x.c b/src/x.c
index f3e02fa465280d2cc5daaede2d5751a642a021d4..9a387749569e87092c1cc5709cdf0d2a99b37087 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -789,7 +789,7 @@ void x_push_node(Con *con) {
             int width = MAX((int32_t)rect.width, 1);
             int height = MAX((int32_t)rect.height, 1);
 
-            xcb_create_pixmap_checked(conn, win_depth, con->frame_buffer.id, con->frame.id, width, height);
+            xcb_create_pixmap(conn, win_depth, con->frame_buffer.id, con->frame.id, width, height);
             draw_util_surface_init(conn, &(con->frame_buffer), con->frame_buffer.id,
                                    get_visualtype_by_id(get_visualid_by_depth(win_depth)), width, height);