1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-05 00:02:41 +03:00
Files
glibc/malloc
Osama Abdelkader 57ce2d8243 Fix allocation_index increment in malloc_internal
The allocation_index was being incremented before checking if mmap()
succeeds.  If mmap() fails, allocation_index would still be incremented,
creating a gap in the allocations tracking array and making
allocation_index inconsistent with the actual number of successful
allocations.

This fix moves the allocation_index increment to after the mmap()
success check, ensuring it only increments when an allocation actually
succeeds.  This maintains proper tracking for leak detection and
prevents gaps in the allocations array.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-12-01 13:35:36 +01:00
..
2021-02-23 10:04:45 +01:00
2014-01-02 09:40:10 +01:00
2007-12-16 22:57:57 +00:00