Skip to content

Commit

Permalink
Properly deallocate friends' status messages in kill_messenger
Browse files Browse the repository at this point in the history
Lightly tested. I'm not sure whether this creates a double-free
bug
  • Loading branch information
stal888 committed Apr 24, 2014
1 parent 38e3b35 commit 2b28353
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions toxcore/Messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1816,6 +1816,10 @@ void kill_messenger(Messenger *m)
kill_DHT(m->dht);
kill_net_crypto(m->net_crypto);
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);
}
Expand Down

0 comments on commit 2b28353

Please sign in to comment.