* tests/test-realloc-posix.c (main): Don't clobber variable 'p' in
failing call.
+2024-10-31 Bruno Haible <bruno@clisp.org>
+
+ realloc-posix tests: Fix memory leak.
+ * tests/test-realloc-posix.c (main): Don't clobber variable 'p' in
+ failing call.
+
2024-10-31 Bruno Haible <bruno@clisp.org>
calloc-posix: Add tests.
if (PTRDIFF_MAX < SIZE_MAX)
{
size_t one = argc != 12345;
- p = realloc (p, PTRDIFF_MAX + one);
- ASSERT (p == NULL);
+ void *volatile r = realloc (p, PTRDIFF_MAX + one);
+ ASSERT (r == NULL);
/* Avoid a test failure due to glibc bug
<https://sourceware.org/bugzilla/show_bug.cgi?id=27870>. */
if (!getenv ("MALLOC_CHECK_"))