Bugfix: Check screen for NULL, free client memory correctly (Thanks dirkson)

This commit is contained in:
Michael Stapelberg
2009-06-24 19:22:09 +02:00
parent 61b1279f67
commit 675d28dd54
2 changed files with 7 additions and 3 deletions

View 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]);