Fix a bug reported in
@@ -141,10 +141,11 @@ sctp_userspace_get_mtu_from_ifn(uint32_t if_index, int af)
goto cleanup;
}
for (pAdapt = pAdapterAddrs; pAdapt; pAdapt = pAdapt->Next) {
- if (pAdapt->IfIndex == if_index)
+ if (pAdapt->IfIndex == if_index) {
ret = pAdapt->Mtu;
break;
}
+ }
cleanup:
if (pAdapterAddrs != NULL) {
GlobalFree(pAdapterAddrs);
@@ -205,7 +206,7 @@ Win_getifaddrs(struct ifaddrs** interfaces)
goto cleanup;
}
/* Enumerate through each returned adapter and save its information */
- for (pAdapt = pAdapterAddrs, count; pAdapt; pAdapt = pAdapt->Next, count++) {
+ for (pAdapt = pAdapterAddrs; pAdapt; pAdapt = pAdapt->Next, count++) {
addr = (struct sockaddr_in *)malloc(sizeof(struct sockaddr_in));
ifa = (struct ifaddrs *)malloc(sizeof(struct ifaddrs));
if ((addr == NULL) || (ifa == NULL)) {
@@ -244,7 +245,7 @@ Win_getifaddrs(struct ifaddrs** interfaces)
goto cleanup;
}
/* Enumerate through each returned adapter and save its information */
- for (pAdapt = pAdapterAddrs, count; pAdapt; pAdapt = pAdapt->Next, count++) {
+ for (pAdapt = pAdapterAddrs; pAdapt; pAdapt = pAdapt->Next, count++) {
addr6 = (struct sockaddr_in6 *)malloc(sizeof(struct sockaddr_in6));
ifa = (struct ifaddrs *)malloc(sizeof(struct ifaddrs));
if ((addr6 == NULL) || (ifa == NULL)) {
