Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ea2e6d0dea2ce2d9031cb3fbf3e28b6f40890483
      
https://github.com/WebKit/WebKit/commit/ea2e6d0dea2ce2d9031cb3fbf3e28b6f40890483
  Author: Olivier Blin <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M Source/WTF/wtf/malloc_heap_breakdown/main.cpp

  Log Message:
  -----------
  [GTK][WPE] Fix tracking and leaking reallocated memory with 
MALLOC_HEAP_BREAKDOWN
https://bugs.webkit.org/show_bug.cgi?id=300882

Reviewed by Michael Catanzaro.

Memory reallocated with zoneRealloc() was not tracked properly.

If realloc() returns a different pointer, the old pointer is left
accounted for in the zone allocations with the new size, and the new
pointer is not tracked at all.

So when the new pointer is freed by zoneFree():
- the new memory was leaked because the function checks if the
  allocation is tracked before calling free()
- the old pointer allocation was left in the allocation statistics

This has been noticed with a backport of this feature on WPE 2.42,
which showed incorrect leaks of AssemblerData and MetadataTable objects.

* Source/WTF/wtf/malloc_heap_breakdown/main.cpp:
(MallocZoneHeapManager::zoneRealloc):

Canonical link: https://commits.webkit.org/301709@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to