iphlapi: Fix some leaks (coverity).

This commit is contained in:
Frédéric Delanoy 2012-11-07 10:36:46 +01:00 committed by Alexandre Julliard
parent 32f636f6d1
commit 82c97d954d
2 changed files with 5 additions and 0 deletions

View File

@ -741,6 +741,8 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags)
ifp->ifa_addr);
i++;
}
if (ret)
HeapFree(GetProcessHeap(), 0, *ppIpAddrTable);
}
else
ret = ERROR_OUTOFMEMORY;
@ -928,6 +930,8 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags)
&ifr->ifr_addr);
i++;
}
if (ret)
HeapFree(GetProcessHeap(), 0, *ppIpAddrTable);
}
else
ret = ERROR_OUTOFMEMORY;

View File

@ -784,6 +784,7 @@ static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index
}
if (ret)
{
HeapFree(GetProcessHeap(), 0, v4addrs);
HeapFree(GetProcessHeap(), 0, routeTable);
return ret;
}