mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
8208676: Missing NULL check and resource leak in NetworkPerformanceInterface::NetworkPerformance::network_utilization
Reviewed-by: mgronlun, rehn
This commit is contained in:
parent
2f1aae720b
commit
961156b1d5
2 changed files with 3 additions and 1 deletions
|
@ -1107,7 +1107,7 @@ int NetworkPerformanceInterface::NetworkPerformance::network_utilization(Network
|
|||
|
||||
NetworkInterface* ret = NULL;
|
||||
for (cur_address = addresses; cur_address != NULL; cur_address = cur_address->ifa_next) {
|
||||
if (cur_address->ifa_addr->sa_family != AF_PACKET) {
|
||||
if ((cur_address->ifa_addr == NULL) || (cur_address->ifa_addr->sa_family != AF_PACKET)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1118,6 +1118,7 @@ int NetworkPerformanceInterface::NetworkPerformance::network_utilization(Network
|
|||
ret = cur;
|
||||
}
|
||||
|
||||
freeifaddrs(addresses);
|
||||
*network_interfaces = ret;
|
||||
|
||||
return OS_OK;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue