From 0af78c783112a99f2b3ac4ef0b0807d3c6517df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 6 Jul 2026 21:20:57 +0200 Subject: [PATCH] iconv: Fix memory management in autoconf test for `//IGNORE` Sometimes running `./configure` for ASAN hangs on my machine. This is reproducible when compiling and running the program manually using clang-16 -g -fsanitize=undefined,address test.c It seems this is related to the LLVM symbolizer getting stuck, and the symbolizer is likely required to report the memory leak. After adding the memory management functions it seems to work (or rather fail) reliably. --- ext/iconv/config.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4 index e86f3535a97c..bea97b27f4f7 100644 --- a/ext/iconv/config.m4 +++ b/ext/iconv/config.m4 @@ -112,6 +112,8 @@ int main(void) { char *out = malloc(out_left); char *out_p = out; size_t result = iconv(cd, (char **) &in_p, &in_left, (char **) &out_p, &out_left); + free(out); + iconv_close(cd); if(result == (size_t)-1) { return 1; }