Browse Source

P2P: Deinit GO group data before global P2P deinit

This avoids issues with using freed memory in p2p_group_deinit().
Jouni Malinen 14 years ago
parent
commit
743ef79914
1 changed files with 9 additions and 0 deletions
  1. 9 0
      wpa_supplicant/p2p_supplicant.c

+ 9 - 0
wpa_supplicant/p2p_supplicant.c

@@ -2268,6 +2268,15 @@ void wpas_p2p_deinit_global(struct wpa_global *global)
 		os_free(ifname);
 		os_free(ifname);
 	}
 	}
 
 
+	/*
+	 * Deinit GO data on any possibly remaining interface (if main
+	 * interface is used as GO).
+	 */
+	for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
+		if (wpa_s->ap_iface)
+			wpas_p2p_group_deinit(wpa_s);
+	}
+
 	p2p_deinit(global->p2p);
 	p2p_deinit(global->p2p);
 	global->p2p = NULL;
 	global->p2p = NULL;
 }
 }