client: Remove link if seat_add_client succeeds
Removing the link before before means that we can return without a link, resulting in a double-remove.
This commit is contained in:
parent
ffd6f039f8
commit
cedd64c283
1 changed files with 1 additions and 1 deletions
|
@ -145,11 +145,11 @@ static int handle_open_seat(struct client *client) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
linked_list_remove(&client->link);
|
|
||||||
if (seat_add_client(seat, client) == -1) {
|
if (seat_add_client(seat, client) == -1) {
|
||||||
log_errorf("unable to add client to target seat: %s", strerror(errno));
|
log_errorf("unable to add client to target seat: %s", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
linked_list_remove(&client->link);
|
||||||
linked_list_insert(&seat->clients, &client->link);
|
linked_list_insert(&seat->clients, &client->link);
|
||||||
|
|
||||||
size_t seat_name_len = strlen(seat_name);
|
size_t seat_name_len = strlen(seat_name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue