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() {
|
static void run() {
|
||||||
Channel *c;
|
Channel *c, *n;
|
||||||
int r, maxfd;
|
int r, maxfd;
|
||||||
fd_set rd;
|
fd_set rd;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
@ -455,9 +455,11 @@ static void run() {
|
|||||||
handle_server_output();
|
handle_server_output();
|
||||||
last_response = time(NULL);
|
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))
|
if(FD_ISSET(c->fd, &rd))
|
||||||
handle_channels_input(c);
|
handle_channels_input(c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user