Fix handle use after free
This commit is contained in:
parent
fde5d543a6
commit
b508aaca27
@ -33,12 +33,12 @@ void
|
||||
Handle_Destroy(Process *proc)
|
||||
{
|
||||
int i;
|
||||
Handle *handle;
|
||||
Handle *handle, *handle_tmp;
|
||||
|
||||
for (i = 0; i < PROCESS_HANDLE_SLOTS; i++) {
|
||||
TAILQ_FOREACH(handle, &proc->handles[i], handleList) {
|
||||
(handle->close)(handle);
|
||||
TAILQ_FOREACH_SAFE(handle, &proc->handles[i], handleList, handle_tmp) {
|
||||
TAILQ_REMOVE(&proc->handles[i], handle, handleList);
|
||||
(handle->close)(handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user