selftest/net/ovpn: fix crash in case of getaddrinfo() failure
authorAntonio Quartulli <antonio@openvpn.net>
Tue, 6 May 2025 12:56:54 +0000 (14:56 +0200)
committerAntonio Quartulli <antonio@openvpn.net>
Thu, 15 May 2025 11:09:36 +0000 (13:09 +0200)
commit8624daf9f27dc9c58e266319b44d5c0f8d6a67df
tree4fe22c242f58e0d029a8cb2a44ab24f4a42cbaf1
parent4ca6438da45688dae5c5958f640560f9496f21a4
selftest/net/ovpn: fix crash in case of getaddrinfo() failure

getaddrinfo() may fail with error code different from EAI_FAIL
or EAI_NONAME, however in this case we still try to free the
results object, thus leading to a crash.

Fix this by bailing out on any possible error.

Fixes: 959bc330a439 ("testing/selftests: add test tool and scripts for ovpn module")
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
tools/testing/selftests/net/ovpn/ovpn-cli.c