Re: [PATCH] hw/intc/apic: fix memory leak

2024-03-08 Thread Philippe Mathieu-Daudé
On 4/3/24 23:41, Paolo Bonzini wrote: deliver_bitmask is allocated on the heap in apic_deliver(), but there are many paths in the function that return before the corresponding g_free() is reached. Fix this by switching to g_autofree and, while at it, also switch to g_new. Do the same in apic_de

Re: [PATCH] hw/intc/apic: fix memory leak

2024-03-05 Thread Alex Bennée
Paolo Bonzini writes: > deliver_bitmask is allocated on the heap in apic_deliver(), but there > are many paths in the function that return before the corresponding > g_free() is reached. Fix this by switching to g_autofree and, while at > it, also switch to g_new. Do the same in apic_deliver_ir

Re: [PATCH] hw/intc/apic: fix memory leak

2024-03-05 Thread Bui Quang Minh
On 3/5/24 05:41, Paolo Bonzini wrote: deliver_bitmask is allocated on the heap in apic_deliver(), but there are many paths in the function that return before the corresponding g_free() is reached. Fix this by switching to g_autofree and, while at it, also switch to g_new. Do the same in apic_de

Re: [PATCH] hw/intc/apic: fix memory leak

2024-03-05 Thread Philippe Mathieu-Daudé
On 4/3/24 23:41, Paolo Bonzini wrote: deliver_bitmask is allocated on the heap in apic_deliver(), but there are many paths in the function that return before the corresponding g_free() is reached. Fix this by switching to g_autofree and, while at it, also switch to g_new. Do the same in apic_de

[PATCH] hw/intc/apic: fix memory leak

2024-03-04 Thread Paolo Bonzini
deliver_bitmask is allocated on the heap in apic_deliver(), but there are many paths in the function that return before the corresponding g_free() is reached. Fix this by switching to g_autofree and, while at it, also switch to g_new. Do the same in apic_deliver_irq() as well for consistency. Fi