P2P: Fix code order to avoid potential NULL pointer dereference

This commit is contained in:
Jouni Malinen 2010-07-29 16:20:02 -07:00 committed by Jouni Malinen
parent e1f1509bb0
commit 0cc8be3e45

View file

@ -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) {