1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-03 13:16:44 +02:00

Fix two memory leaks and properly clean up friendlist window

This commit is contained in:
jfreegman
2018-10-09 14:21:33 -04:00
parent ce6d4861fb
commit d18cc8cbc2
4 changed files with 27 additions and 25 deletions

View File

@ -113,11 +113,9 @@ static void realloc_blocklist(int n)
Blocked.index = b_idx;
}
void kill_friendlist(void)
void kill_friendlist(ToxWindow *self)
{
int i;
for (i = 0; i < Friends.max_idx; ++i) {
for (int i = 0; i < Friends.max_idx; ++i) {
if (Friends.list[i].active && Friends.list[i].group_invite.key != NULL) {
free(Friends.list[i].group_invite.key);
}
@ -125,6 +123,8 @@ void kill_friendlist(void)
realloc_blocklist(0);
realloc_friends(0);
free(self->help);
del_window(self);
}
/* Saves the blocklist to path. If there are no items in the blocklist the