Skip to content

Commit

Permalink
remove redundant comparisons after reallocs
Browse files Browse the repository at this point in the history
  • Loading branch information
zugz committed Sep 4, 2018
1 parent 0cb023f commit df1863f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions toxcore/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ static int note_peer_active(Group_Chats *g_c, uint32_t groupnumber, uint16_t pee

Group_Peer *frozen_temp = (Group_Peer *)realloc(g->frozen, sizeof(Group_Peer) * (g->numfrozen));

if (frozen_temp == nullptr && g->numfrozen > 0) {
if (frozen_temp == nullptr) {
return -1;
}

Expand Down Expand Up @@ -684,7 +684,7 @@ static int delpeer(Group_Chats *g_c, uint32_t groupnumber, int peer_index, void

Group_Peer *temp = (Group_Peer *)realloc(g->group, sizeof(Group_Peer) * (g->numpeers));

if (temp == nullptr && g->numpeers > 0) {
if (temp == nullptr) {
return -1;
}

Expand Down

0 comments on commit df1863f

Please sign in to comment.