mirror of
https://github.com/nmap/nmap.git
synced 2025-12-20 14:39:02 +00:00
libdnet: Remove call to FreeLibrary after GetModuleHandle.
Per Windows API docs: "do not pass a handle returned by GetModuleHandle to the FreeLibrary function. Doing so can cause a DLL module to be unmapped prematurely."
This commit is contained in:
@@ -2543,3 +2543,21 @@ index 1399db2..352da4c 100644
|
|||||||
if (strcmp(name, a->AdapterName) == 0)
|
if (strcmp(name, a->AdapterName) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
o Remove call to FreeLibrary after GetModuleHandle. Windows API docs say:
|
||||||
|
"do not pass a handle returned by GetModuleHandle to the FreeLibrary function.
|
||||||
|
Doing so can cause a DLL module to be unmapped prematurely."
|
||||||
|
|
||||||
|
diff --git a/libdnet-stripped/src/route-win32.c b/libdnet-stripped/src/route-win32.c
|
||||||
|
index c69b29b..8a9d2bc 100644
|
||||||
|
--- a/libdnet-stripped/src/route-win32.c
|
||||||
|
+++ b/libdnet-stripped/src/route-win32.c
|
||||||
|
@@ -269,8 +269,6 @@ route_t *
|
||||||
|
route_close(route_t *r)
|
||||||
|
{
|
||||||
|
if (r != NULL) {
|
||||||
|
- if (r->iphlpapi != NULL)
|
||||||
|
- FreeLibrary(r->iphlpapi);
|
||||||
|
if (r->ipftable != NULL)
|
||||||
|
free(r->ipftable);
|
||||||
|
if (r->ipftable2 != NULL)
|
||||||
|
|||||||
@@ -269,8 +269,6 @@ route_t *
|
|||||||
route_close(route_t *r)
|
route_close(route_t *r)
|
||||||
{
|
{
|
||||||
if (r != NULL) {
|
if (r != NULL) {
|
||||||
if (r->iphlpapi != NULL)
|
|
||||||
FreeLibrary(r->iphlpapi);
|
|
||||||
if (r->ipftable != NULL)
|
if (r->ipftable != NULL)
|
||||||
free(r->ipftable);
|
free(r->ipftable);
|
||||||
if (r->ipftable2 != NULL)
|
if (r->ipftable2 != NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user