From 75e842f559b437af7e805d639486b4b37b98a8f2 Mon Sep 17 00:00:00 2001 From: Marcel Apfelbaum Date: Thu, 5 Jun 2014 07:09:18 +0200 Subject: [PATCH 9/9] hmp: Fix freeing of PciInfoList RH-Author: Marcel Apfelbaum Message-id: <1401952158-29608-8-git-send-email-marcel.a@redhat.com> Patchwork-id: 59153 O-Subject: [RHEL-6.6 qemu-kvm PATCH v5 7/7] hmp: Fix freeing of PciInfoList Bugzilla: 813748 RH-Acked-by: Michael S. Tsirkin RH-Acked-by: Laszlo Ersek RH-Acked-by: Luiz Capitulino From: Stefan Berger Remember the original PciInfoList in info_list and use the info variable to traverse the list. Signed-off-by: Stefan Berger Signed-off-by: Stefan Hajnoczi (cherry picked from commit f46cee374218dc5ebda3e7aa6996ef7f1b90eb7c) Signed-off-by: Marcel Apfelbaum --- hmp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Signed-off-by: jen --- hmp.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hmp.c b/hmp.c index 1c0337c..a173c03 100644 --- a/hmp.c +++ b/hmp.c @@ -194,17 +194,17 @@ static void hmp_info_pci_device(Monitor *mon, const PciDeviceInfo *dev) void hmp_info_pci(Monitor *mon) { - PciInfoList *info; + PciInfoList *info_list, *info; Error *err = NULL; - info = qmp_query_pci(&err); + info_list = qmp_query_pci(&err); if (err) { monitor_printf(mon, "PCI devices not supported\n"); error_free(err); return; } - for (; info; info = info->next) { + for (info = info_list; info; info = info->next) { PciDeviceInfoList *dev; for (dev = info->value->devices; dev; dev = dev->next) { @@ -212,5 +212,5 @@ void hmp_info_pci(Monitor *mon) } } - qapi_free_PciInfoList(info); + qapi_free_PciInfoList(info_list); } -- 1.7.1