From: Paul Floyd Date: Sat, 17 Feb 2024 17:49:31 +0000 (+0100) Subject: musl regtest: fix crash in helgrind getaddrinfo X-Git-Tag: VALGRIND_3_23_0~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c6728fc5ef2f458e733bd94668bcc14944a718d;p=thirdparty%2Fvalgrind.git musl regtest: fix crash in helgrind getaddrinfo musl doesn't like it if you pass in NULL to freeaddrinfo. --- diff --git a/helgrind/tests/getaddrinfo.c b/helgrind/tests/getaddrinfo.c index 9c9bcc1c5c..fc3b0a9d56 100644 --- a/helgrind/tests/getaddrinfo.c +++ b/helgrind/tests/getaddrinfo.c @@ -34,7 +34,11 @@ int main(void) { } for (i = 0; i < threaddat_size; ++i) { pthread_join(threads[i], 0); - freeaddrinfo(threaddat[i].res); + // musl crashes if you pass a NULL pointer to freeaddrinfo + if (threaddat[i].res) + { + freeaddrinfo(threaddat[i].res); + } } return 0; }