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

2025-06-13 Thread Zhijian Li (Fujitsu)
On 13/06/2025 16:07, Daniel P. Berrangé wrote: > On Fri, Jun 13, 2025 at 12:40:02PM +0800, Li Zhijian via 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

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

2025-06-13 Thread Daniel P . Berrangé
On Fri, Jun 13, 2025 at 12:40:02PM +0800, Li Zhijian via 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 mem

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

2025-06-13 Thread Ani Sinha
> On 13 Jun 2025, at 10:10 AM, 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 leak

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

2025-06-12 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. Fix this by moving the GPtrAr