RFR: 8362884: [GCC static analyzer] unix NetworkInterface.c addif leak on early returns

Daniel Fuchs dfuchs at openjdk.org
Wed Aug 27 09:55:44 UTC 2025


On Wed, 27 Aug 2025 07:29:11 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:

> Fixes `NetworkInterface.c::addif` memory leak on early returns. Issue reproduction is difficult – didn't add a test.

The fact that `CHECKED_MALLOC3` relies on the fact that it's being called from within a method that returns a `netif*` pointer and has a `netif* ifs` parameter is a bit smelly, but it was preexisting and I like that this change is kept minimal. So I'd say it looks good to me. 

FWIW: I double checked and it does look like the windows version of this file does not have the same issue that is being fixed here.

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

Marked as reviewed by dfuchs (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26952#pullrequestreview-3159128989


More information about the net-dev mailing list