Skip to content

Commit

Permalink
check for NULL before freeing...
Browse files Browse the repository at this point in the history
  • Loading branch information
zugz committed Aug 19, 2018
1 parent bc82582 commit d2ffce1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions toxcore/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,8 +1002,13 @@ int del_groupchat(Group_Chats *g_c, uint32_t groupnumber)
g->peer_on_leave(g->object, groupnumber, g->group[i].object);
}

free(g->group);
free(g->frozen);
if (g->group) {
free(g->group);
}

if (g->frozen) {
free(g->frozen);
}

if (g->group_on_delete) {
g->group_on_delete(g->object, groupnumber);
Expand Down

0 comments on commit d2ffce1

Please sign in to comment.