mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed use of it after free.
This commit is contained in:
parent
9a87f03aec
commit
1d91699e8e
|
@ -154,9 +154,11 @@ int msi_kill (MSISession *session)
|
|||
|
||||
MSICall *it = get_call(session, session->calls_head);
|
||||
|
||||
for (; it; it = it->next) {
|
||||
while (it) {
|
||||
send_message(session->messenger, it->friend_number, &msg);
|
||||
kill_call(it); /* This will eventually free session->calls */
|
||||
MSICall *temp_it = it;
|
||||
it = it->next;
|
||||
kill_call(temp_it); /* This will eventually free session->calls */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user