mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 01:54:24 +03:00
Ticket #3915: code clean up before 4.8.22 release.
(destroy_task_and_return_fd): fix access after free. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
791148ed66
commit
08136039b6
@ -112,13 +112,15 @@ destroy_task_and_return_fd (pid_t pid)
|
||||
{
|
||||
if (p->pid == pid)
|
||||
{
|
||||
int fd = p->fd;
|
||||
|
||||
if (prev)
|
||||
prev->next = p->next;
|
||||
else
|
||||
task_list = p->next;
|
||||
g_free (p->info);
|
||||
g_free (p);
|
||||
return p->fd;
|
||||
return fd;
|
||||
}
|
||||
prev = p;
|
||||
p = p->next;
|
||||
|
Loading…
Reference in New Issue
Block a user