1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-05 14:09:02 +00:00

Don't call WSACleanup if WSAStartup wasn't called

This commit is contained in:
dmiller
2024-09-04 18:41:44 +00:00
parent fbadb5256b
commit 75f6b387fe
2 changed files with 2 additions and 2 deletions

View File

@@ -93,6 +93,7 @@ void win_pre_init() {
werd = MAKEWORD( 2, 2 );
if( (WSAStartup(werd, &data)) !=0 )
fatal("failed to start winsock.\n");
atexit(win_cleanup);
}
/* Check if the NPCAP service is running on Windows, and try to start it if it's
@@ -258,7 +259,6 @@ void win_init()
if (!o.have_pcap)
o.isr00t = 0;
atexit(win_cleanup);
}

View File

@@ -91,6 +91,7 @@ void win_pre_init() {
werd = MAKEWORD( 2, 2 );
if( (WSAStartup(werd, &data)) !=0 )
fatal("failed to start winsock.\n");
atexit(win_cleanup);
}
/* Check if the NPCAP service is running on Windows, and try to start it if it's
@@ -255,7 +256,6 @@ void win_init()
if (!o.havePcap())
o.setIsRoot(0);
atexit(win_cleanup);
}