diff options
author | Kenny Levinsen <kl@kl.wtf> | 2021-02-27 21:22:45 +0100 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2021-02-27 21:46:38 +0100 |
commit | cedd64c283794c5b6593f308cddde2cdab7c2bcf (patch) | |
tree | 56480fccd0b75120aa6becb1c09a102a000772e8 /seatd | |
parent | ffd6f039f8b29ec9f53f6b88a432f8257a5489e2 (diff) |
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.
Diffstat (limited to 'seatd')
-rw-r--r-- | seatd/client.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/seatd/client.c b/seatd/client.c index 949bbd8..286a3ae 100644 --- a/seatd/client.c +++ b/seatd/client.c @@ -145,11 +145,11 @@ static int handle_open_seat(struct client *client) { return -1; } - linked_list_remove(&client->link); if (seat_add_client(seat, client) == -1) { log_errorf("unable to add client to target seat: %s", strerror(errno)); return -1; } + linked_list_remove(&client->link); linked_list_insert(&seat->clients, &client->link); size_t seat_name_len = strlen(seat_name); |