mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 23:29:25 +00:00
win32 pcapif: fix "heap-use-after-free" on shutdown
This commit is contained in:
parent
3792075baf
commit
f7fe057821
@ -679,12 +679,17 @@ pcapif_shutdown(struct netif *netif)
|
||||
#endif /* PCAPIF_RX_USE_THREAD */
|
||||
if (pa->adapter) {
|
||||
pcap_breakloop(pa->adapter);
|
||||
pcap_close(pa->adapter);
|
||||
}
|
||||
#if PCAPIF_RX_USE_THREAD
|
||||
/* wait for rxthread to end */
|
||||
while(pa->rx_running);
|
||||
while (pa->rx_running) {
|
||||
Sleep(100);
|
||||
}
|
||||
#endif /* PCAPIF_RX_USE_THREAD */
|
||||
if (pa->adapter) {
|
||||
pcap_close(pa->adapter);
|
||||
pa->adapter = NULL;
|
||||
}
|
||||
#if PCAPIF_HANDLE_LINKSTATE
|
||||
pcapifh_linkstate_close(pa->link_state);
|
||||
#endif /* PCAPIF_HANDLE_LINKSTATE */
|
||||
|
Loading…
Reference in New Issue
Block a user