Fixed use of it after free.

This commit is contained in:
irungentoo 2015-12-15 15:12:38 -05:00
parent 9a87f03aec
commit 1d91699e8e
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -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 */
}
}