P2P: Fix code order to avoid potential NULL pointer dereference
This commit is contained in:
parent
e1f1509bb0
commit
0cc8be3e45
1 changed files with 3 additions and 1 deletions
|
@ -100,11 +100,13 @@ static void p2p_group_free_members(struct p2p_group *group)
|
|||
void p2p_group_deinit(struct p2p_group *group)
|
||||
{
|
||||
size_t g;
|
||||
struct p2p_data *p2p = group->p2p;
|
||||
struct p2p_data *p2p;
|
||||
|
||||
if (group == NULL)
|
||||
return;
|
||||
|
||||
p2p = group->p2p;
|
||||
|
||||
for (g = 0; g < p2p->num_groups; g++) {
|
||||
if (p2p->groups[g] == group) {
|
||||
while (g + 1 < p2p->num_groups) {
|
||||
|
|
Loading…
Reference in a new issue