Skip to content

Commit 0af78c7

Browse files
committed
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.
1 parent 6beb089 commit 0af78c7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

ext/iconv/config.m4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ int main(void) {
112112
char *out = malloc(out_left);
113113
char *out_p = out;
114114
size_t result = iconv(cd, (char **) &in_p, &in_left, (char **) &out_p, &out_left);
115+
free(out);
116+
iconv_close(cd);
115117
if(result == (size_t)-1) {
116118
return 1;
117119
}

0 commit comments

Comments
 (0)