diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-05-13 21:11:46 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-05-13 21:11:46 +0100 |
commit | 09a2246b00fdb5b18db13b65d6496511dabba238 (patch) | |
tree | eedda2869ee8d55560a25e316dfa0db7227fe6da /server-client.c | |
parent | e6d9f3f90cbc469ae9b93749a20c7d12536a6bad (diff) | |
download | rtmux-09a2246b00fdb5b18db13b65d6496511dabba238.tar.gz rtmux-09a2246b00fdb5b18db13b65d6496511dabba238.tar.bz2 rtmux-09a2246b00fdb5b18db13b65d6496511dabba238.zip |
Use safe loop for freeing client files.
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/server-client.c b/server-client.c index 6e24fdf3..2e9f15a6 100644 --- a/server-client.c +++ b/server-client.c @@ -211,7 +211,6 @@ server_client_create(int fd) c->queue = cmdq_new(); c->tty.fd = -1; - c->tty.sx = 80; c->tty.sy = 24; @@ -270,7 +269,7 @@ server_client_open(struct client *c, char **cause) void server_client_lost(struct client *c) { - struct client_file *cf; + struct client_file *cf, *cf1; c->flags |= CLIENT_DEAD; @@ -278,7 +277,7 @@ server_client_lost(struct client *c) status_prompt_clear(c); status_message_clear(c); - RB_FOREACH(cf, client_files, &c->files) { + RB_FOREACH_SAFE(cf, client_files, &c->files, cf1) { cf->error = EINTR; file_fire_done(cf); } @@ -2252,7 +2251,7 @@ server_client_set_flags(struct client *c, const char *flags) } -/*Get client flags. This is only flags useful to show to users. */ +/* Get client flags. This is only flags useful to show to users. */ const char * server_client_get_flags(struct client *c) { |