Hi,
The attached patch fixes a memory leak in the conftest.c file. I'm
aware this code is only test compiled and never executed so there is
no actual leak, but the obvious memory leak here is causing problems
with a downstream compiler (the compiler is more strict about memory
leaks and keeps generating warnings when used in autoconf projects
that compile this file during configure).
Thanks,
- Raphael Isemann
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index 48bd49a3..ae0a89cd 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -1319,28 +1319,29 @@ ac_c_conftest_c99_main='
if (test_restrict ("String literal") == 0)
success = true;
char *restrict newvar = "Another string";
// Check varargs.
success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234);
test_varargs_macros ();
// Check flexible array members.
struct incomplete_array *ia =
malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
ia->datasize = 10;
for (int i = 0; i < ia->datasize; ++i)
ia->data[i] = i * 1.234;
+ free(ia);
// Check named initializers.
struct named_init ni = {
.number = 34,
.name = L"Test wide string",
.average = 543.34343,
};
ni.number = 58;
int dynamic_array[ni.number];
dynamic_array[0] = argv[0][0];
dynamic_array[ni.number - 1] = 543;