* key.c (delete_select_channel): Avoid using freed memory.
Этот коммит содержится в:
родитель
c46d1f590b
Коммит
d0b31c1c81
@ -1,3 +1,7 @@
|
||||
2002-08-10 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* key.c (delete_select_channel): Avoid using freed memory.
|
||||
|
||||
2002-08-09 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* ext.c (exec_extension): Eliminate unused argument.
|
||||
|
17
src/key.c
17
src/key.c
@ -109,17 +109,24 @@ void add_select_channel (int fd, select_fn callback, void *info)
|
||||
void delete_select_channel (int fd)
|
||||
{
|
||||
SelectList *p = select_list;
|
||||
SelectList *prev = 0;
|
||||
SelectList *p_prev = 0;
|
||||
SelectList *p_next;
|
||||
|
||||
while (p) {
|
||||
if (p->fd == fd) {
|
||||
if (prev)
|
||||
prev->next = p->next;
|
||||
p_next = p->next;
|
||||
|
||||
if (p_prev)
|
||||
p_prev->next = p_next;
|
||||
else
|
||||
select_list = p->next;
|
||||
select_list = p_next;
|
||||
|
||||
g_free (p);
|
||||
p = p_next;
|
||||
continue;
|
||||
}
|
||||
prev = p;
|
||||
|
||||
p_prev = p;
|
||||
p = p->next;
|
||||
}
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user