mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Properly deallocate friends' status messages in kill_messenger
Lightly tested. I'm not sure whether this creates a double-free bug
This commit is contained in:
parent
38e3b3516c
commit
2b28353554
|
@ -1816,6 +1816,10 @@ void kill_messenger(Messenger *m)
|
||||||
kill_DHT(m->dht);
|
kill_DHT(m->dht);
|
||||||
kill_net_crypto(m->net_crypto);
|
kill_net_crypto(m->net_crypto);
|
||||||
kill_networking(m->net);
|
kill_networking(m->net);
|
||||||
|
for (i = 0; i < m->numfriends; ++i) {
|
||||||
|
if (m->friendlist[i].statusmessage)
|
||||||
|
free(m->friendlist[i].statusmessage);
|
||||||
|
}
|
||||||
free(m->friendlist);
|
free(m->friendlist);
|
||||||
free(m);
|
free(m);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user