summaryrefslogtreecommitdiff
path: root/src/core/servers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/servers.c')
-rw-r--r--src/core/servers.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/servers.c b/src/core/servers.c
index 4828750b..4f5b0402 100644
--- a/src/core/servers.c
+++ b/src/core/servers.c
@@ -361,15 +361,16 @@ int server_start_connect(SERVER_REC *server)
static int server_remove_channels(SERVER_REC *server)
{
- GSList *tmp;
+ GSList *tmp, *next;
int found;
g_return_val_if_fail(server != NULL, FALSE);
found = FALSE;
- for (tmp = server->channels; tmp != NULL; tmp = tmp->next) {
+ for (tmp = server->channels; tmp != NULL; tmp = next) {
CHANNEL_REC *channel = tmp->data;
+ next = tmp->next;
channel_destroy(channel);
found = TRUE;
}