Re: [PATCH v2] hw/acpi: Fix GPtrArray memory leak in crs_range_merge

2025-06-13 Thread Ani Sinha
> On 13 Jun 2025, at 2:35 PM, Daniel P. Berrangé wrote: > > On Fri, Jun 13, 2025 at 04:51:10PM +0800, Li Zhijian wrote: >> This leak was detected by the valgrind. >> >> The crs_range_merge() function unconditionally allocated a GPtrArray >> 'even when range->len was zero, causing an early ret

Re: [PATCH v2] hw/acpi: Fix GPtrArray memory leak in crs_range_merge

2025-06-13 Thread Daniel P . Berrangé
On Fri, Jun 13, 2025 at 04:51:10PM +0800, Li Zhijian wrote: > This leak was detected by the valgrind. > > The crs_range_merge() function unconditionally allocated a GPtrArray > 'even when range->len was zero, causing an early return without freeing > the allocated array. This resulted in a memory

[PATCH v2] hw/acpi: Fix GPtrArray memory leak in crs_range_merge

2025-06-13 Thread Li Zhijian via
This leak was detected by the valgrind. The crs_range_merge() function unconditionally allocated a GPtrArray 'even when range->len was zero, causing an early return without freeing the allocated array. This resulted in a memory leak when an empty range was processed. Instead of moving the allocat