On Wed, 12 Jan 2022 12:34:35 GMT, Daniel Jelinski <d...@openjdk.java.net> wrote:

>> src/java.base/windows/native/libnet/NetworkInterface.c line 216:
>> 
>>> 214:                 break;
>>> 215:         }
>>> 216:         return -1;
>> 
>> *netifPP = NULL;
>> 
>> and a similar NULL out value for all  return -1  in this function
>
> Why?
> No users of `enumInterfaces` rely on the value returned in the second 
> parameter when `enumInterfaces` returns a negative result. The same is true 
> for `getAllInterfacesAndAddresses`.
> The second parameter was NULL-initialized in a few places; this 
> initialization was not necessary and I just removed it to avoid confusion.

ahh... I see your point now. I missed a few cases where the returned value was 
referenced (free'd) even though the function failed. These should be fixed now.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6090

Reply via email to