]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Revert "Improve MALLOC_DEBUG"
authorWilco Dijkstra <wilco.dijkstra@arm.com>
Mon, 4 Aug 2025 17:31:54 +0000 (17:31 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Mon, 4 Aug 2025 17:31:54 +0000 (17:31 +0000)
This reverts commit 4b3e65682d1895a651653d82f05c66ead8dfcf3b.

malloc/malloc.c

index 3a8aaeb665cc5d5027a82ef50e34af229d3321b4..5257ee24fdff9320333368c11439a38d08904752 100644 (file)
@@ -3456,6 +3456,8 @@ __libc_free (void *mem)
   if (__glibc_unlikely (misaligned_chunk (p)))
     return malloc_printerr_tail ("free(): invalid pointer");
 
+  check_inuse_chunk (arena_for_chunk (p), p);
+
 #if USE_TCACHE
   if (__glibc_likely (size < mp_.tcache_max_bytes && tcache != NULL))
     {
@@ -4678,8 +4680,6 @@ _int_free_merge_chunk (mstate av, mchunkptr p, INTERNAL_SIZE_T size)
 {
   mchunkptr nextchunk = chunk_at_offset(p, size);
 
-  check_inuse_chunk (av, p);
-
   /* Lightweight tests: check whether the block is already the
      top block.  */
   if (__glibc_unlikely (p == av->top))