]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Check screen for NULL, free client memory correctly (Thanks dirkson)
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 24 Jun 2009 17:22:09 +0000 (19:22 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 24 Jun 2009 17:22:09 +0000 (19:22 +0200)
src/handlers.c
src/layout.c

index ae1a5d7fd642964292345b64f63387fc098200bb..3930e1e75d0bb827f00f6952fab071c7a0ce77ff 100644 (file)
@@ -578,9 +578,6 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
 
         client = table_remove(&by_child, event->window);
 
-        if (client->name != NULL)
-                free(client->name);
-
         /* Clients without a container are either floating or dock windows */
         if (client->container != NULL) {
                 Container *con = client->container;
@@ -644,6 +641,8 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
                 client->workspace->screen = NULL;
         }
 
+        FREE(client->window_class);
+        FREE(client->name);
         free(client);
 
         render_layout(conn);
index e70d0f49682217376d50d1512d87217eda3030d4..4f132aea8cc2d8d1f54f2f902b2880a1c6429c5a 100644 (file)
@@ -188,6 +188,11 @@ void reposition_client(xcb_connection_t *conn, Client *client) {
         if (client->workspace->screen == (screen = get_screen_containing(client->rect.x, client->rect.y)))
                 return;
 
+        if (screen == NULL) {
+                LOG("Boundary checking disabled, no screen found for (%d, %d)\n", client->rect.x, client->rect.y);
+                return;
+        }
+
         LOG("Client is on workspace %p with screen %p\n", client->workspace, client->workspace->screen);
         LOG("but screen at %d, %d is %p\n", client->rect.x, client->rect.y, screen);
         floating_assign_to_workspace(client, &workspaces[screen->current_workspace]);