diff --git a/dll/win32/iphlpapi/iphlpapi_main.c b/dll/win32/iphlpapi/iphlpapi_main.c index a9184b2739d..7e0b0c9cc86 100644 --- a/dll/win32/iphlpapi/iphlpapi_main.c +++ b/dll/win32/iphlpapi/iphlpapi_main.c @@ -3186,7 +3186,10 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVO ret = openTcpFile(&tcpFile, FILE_READ_DATA); if (!NT_SUCCESS(ret)) + { + free(indexTable); return ERROR_NO_DATA; + } for (i = indexTable->numIndexes; i >= 0; i--) { diff --git a/dll/win32/iphlpapi/ipstats.h b/dll/win32/iphlpapi/ipstats.h index 66d78c946f2..aa9283eb5dd 100644 --- a/dll/win32/iphlpapi/ipstats.h +++ b/dll/win32/iphlpapi/ipstats.h @@ -83,7 +83,7 @@ typedef enum _CLASS_TABLE { } CLASS_TABLE; /* Allocates and returns to you the route table, or NULL if it can't allocate - * enough memory. free() the returned table. + * enough memory. HeapFree() the returned table. */ RouteTable *getRouteTable(void); @@ -91,7 +91,7 @@ RouteTable *getRouteTable(void); DWORD getNumArpEntries(void); /* Allocates and returns to you the arp table, or NULL if it can't allocate - * enough memory. free() the returned table. + * enough memory. HeapFree() the returned table. */ PMIB_IPNETTABLE getArpTable(void); @@ -99,7 +99,7 @@ PMIB_IPNETTABLE getArpTable(void); DWORD getNumUdpEntries(void); /* Allocates and returns to you the UDP state table, or NULL if it can't - * allocate enough memory. free() the returned table. + * allocate enough memory. HeapFree() the returned table. */ PVOID getUdpTable(CLASS_TABLE Class); @@ -107,7 +107,7 @@ PVOID getUdpTable(CLASS_TABLE Class); DWORD getNumTcpEntries(void); /* Allocates and returns to you the TCP state table, or NULL if it can't - * allocate enough memory. free() the returned table. + * allocate enough memory. HeapFree() the returned table. */ PVOID getTcpTable(CLASS_TABLE Class);