]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
Fix memory leak on error
authorStefano Dong (董兴水) <opensource.dxs@aliyun.com>
Thu, 26 Nov 2015 12:00:12 +0000 (12:00 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 26 Nov 2015 12:27:52 +0000 (14:27 +0200)
hw/ppc/spapr.c: Fix memory leak on error, it was introduced in bc09e0611
hw/acpi/memory_hotplug.c: Fix memory leak on error, it was introduced in 34f2af3d

Signed-off-by: Stefano Dong (董兴水) <opensource.dxs@aliyun.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/acpi/memory_hotplug.c
hw/ppc/spapr.c

index ce428dfc1817bcb56134a0d89fef9bd7423ede79..e4b9a01f80b024aa139c65895d1db1820ddaa568 100644 (file)
@@ -155,6 +155,7 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data,
                 qapi_event_send_mem_unplug_error(dev->id,
                                                  error_get_pretty(local_err),
                                                  &error_abort);
+                error_free(local_err);
                 break;
             }
             trace_mhp_acpi_pc_dimm_deleted(mem_st->selector);
index 030ee3554a8ee8a8e0ca1fa4026e21e419b7e8a5..3bb8bcda4fe0c1795967616891058aeba0bd31e3 100644 (file)
@@ -125,6 +125,7 @@ static XICSState *xics_system_init(MachineState *machine,
             error_report("kernel_irqchip requested but unavailable: %s",
                          error_get_pretty(err));
         }
+        error_free(err);
     }
 
     if (!icp) {