diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index a27a44dc..d9e085fb 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -773,6 +773,8 @@ int del_groupchat(Messenger *m, int groupnumber) break; } + m->numchats = i; + if (i == 0) { free(m->chats); m->chats = NULL;