[IPHLPAPI] GetAdaptersAddresses(): Add 1 free() in ERROR_NO_DATA case (#2526)

And fix 4 comments.
Follow-up to 68d94581.
This commit is contained in:
Serge Gautherie 2020-04-15 13:05:54 +02:00 committed by GitHub
parent 1769793bd1
commit f540b2b20c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -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--)
{

View file

@ -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);