Fix channel use after freeing in main loop
Signed-off-by: Nico Golde <nico@ngolde.de>
This commit is contained in:
parent
165638e3c8
commit
f79e2f0953
6
ii.c
6
ii.c
@ -418,7 +418,7 @@ static void handle_server_output() {
|
||||
}
|
||||
|
||||
static void run() {
|
||||
Channel *c;
|
||||
Channel *c, *n;
|
||||
int r, maxfd;
|
||||
fd_set rd;
|
||||
struct timeval tv;
|
||||
@ -455,11 +455,13 @@ static void run() {
|
||||
handle_server_output();
|
||||
last_response = time(NULL);
|
||||
}
|
||||
for(c = channels; c; c = c->next)
|
||||
for(c = channels; c; c = n) {
|
||||
n = c->next;
|
||||
if(FD_ISSET(c->fd, &rd))
|
||||
handle_channels_input(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int i;
|
||||
|
Loading…
Reference in New Issue
Block a user