diff options
author | irungentoo <irungentoo@gmail.com> | 2015-12-15 15:12:38 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2015-12-15 15:12:38 -0500 |
commit | 1d91699e8e23dab4c221c8402c7f086264a485ee (patch) | |
tree | 064b1100abdc453caadf0f610fd4636117b174f6 /toxav/msi.c | |
parent | 9a87f03aec08bebe4beed3ae4d2391a75e36393b (diff) |
Fixed use of it after free.
Diffstat (limited to 'toxav/msi.c')
-rw-r--r-- | toxav/msi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/toxav/msi.c b/toxav/msi.c index c08c0135..2115a2d0 100644 --- a/toxav/msi.c +++ b/toxav/msi.c | |||
@@ -154,9 +154,11 @@ int msi_kill (MSISession *session) | |||
154 | 154 | ||
155 | MSICall *it = get_call(session, session->calls_head); | 155 | MSICall *it = get_call(session, session->calls_head); |
156 | 156 | ||
157 | for (; it; it = it->next) { | 157 | while (it) { |
158 | send_message(session->messenger, it->friend_number, &msg); | 158 | send_message(session->messenger, it->friend_number, &msg); |
159 | kill_call(it); /* This will eventually free session->calls */ | 159 | MSICall *temp_it = it; |
160 | it = it->next; | ||
161 | kill_call(temp_it); /* This will eventually free session->calls */ | ||
160 | } | 162 | } |
161 | } | 163 | } |
162 | 164 | ||