[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-2.7 v3 18/36] acpi-build: fix array leak
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH for-2.7 v3 18/36] acpi-build: fix array leak |
Date: |
Wed, 3 Aug 2016 18:55:23 +0400 |
From: Marc-André Lureau <address@hidden>
The free_ranges array is used as a temporary pointer array, the segment
should still be freed, however, it shouldn't free the elements themself.
Signed-off-by: Marc-André Lureau <address@hidden>
Tested-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
---
hw/i386/acpi-build.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index a26a4bb..433feba 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -789,7 +789,7 @@ static gint crs_range_compare(gconstpointer a,
gconstpointer b)
static void crs_replace_with_free_ranges(GPtrArray *ranges,
uint64_t start, uint64_t end)
{
- GPtrArray *free_ranges = g_ptr_array_new_with_free_func(crs_range_free);
+ GPtrArray *free_ranges = g_ptr_array_new();
uint64_t free_base = start;
int i;
@@ -813,7 +813,7 @@ static void crs_replace_with_free_ranges(GPtrArray *ranges,
g_ptr_array_add(ranges, g_ptr_array_index(free_ranges, i));
}
- g_ptr_array_free(free_ranges, false);
+ g_ptr_array_free(free_ranges, true);
}
/*
--
2.9.0
- [Qemu-devel] [PATCH for-2.7 v3 08/36] qdist: fix entries memory leak, (continued)
- [Qemu-devel] [PATCH for-2.7 v3 08/36] qdist: fix entries memory leak, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 09/36] tests: fix check-qom-interface leaks, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 10/36] tests: fix check-qom-proplist leaks, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 11/36] tests: fix small leak in test-io-channel-command, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 12/36] tests: fix leak in test-string-input-visitor, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 13/36] portio: keep references on portio, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 14/36] numa: do not leak NumaOptions, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 15/36] pc: simplify passing qemu_irq, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 20/36] char: free MuxDriver when closing, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 21/36] tests: fix qom-test leaks, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 18/36] acpi-build: fix array leak,
marcandre . lureau <=
- [Qemu-devel] [PATCH for-2.7 v3 22/36] pc: free i8259, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 16/36] pc: don't leak a20_line, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 19/36] char: free the tcp connection data when closing, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 17/36] machine: use class base init generated name, marcandre . lureau, 2016/08/03
- [Qemu-devel] [PATCH for-2.7 v3 23/36] pc: keep gsi reference, marcandre . lureau, 2016/08/03