Re: [PATCH v2] softmmu/physmem: fix memory leak in dirty_memory_extend()

2024-08-28 Thread Peter Xu
On Wed, Aug 28, 2024 at 11:07:43AM +0200, David Hildenbrand wrote: > As reported by Peter, we might be leaking memory when removing the > highest RAMBlock (in the weird ram_addr_t space), and adding a new one. > > We will fail to realize that we already allocated bitmaps for more > dirty memory bl

[PATCH v2] softmmu/physmem: fix memory leak in dirty_memory_extend()

2024-08-28 Thread David Hildenbrand
As reported by Peter, we might be leaking memory when removing the highest RAMBlock (in the weird ram_addr_t space), and adding a new one. We will fail to realize that we already allocated bitmaps for more dirty memory blocks, and effectively discard the pointers to them. Fix it by getting rid of