diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index cdf6d9915..cd2fba334 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -2822,6 +2822,7 @@ void p2p_service_flush_asp(struct p2p_data *p2p) } p2p->p2ps_adv_list = NULL; + p2ps_prov_free(p2p); p2p_dbg(p2p, "All ASP advertisements flushed"); } diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c index 54b2ab425..3994ec03f 100644 --- a/src/p2p/p2p_pd.c +++ b/src/p2p/p2p_pd.c @@ -1163,6 +1163,9 @@ out: msg.group_id, msg.group_id_len); } + if (reject != P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE) + p2ps_prov_free(p2p); + if (reject == P2P_SC_SUCCESS) { switch (config_methods) { case WPS_CONFIG_DISPLAY: