From: Pan Nengyuan Date: Fri, 14 Aug 2020 16:02:31 +0000 (-0400) Subject: hw/vfio/ap: Plug memleak in vfio_ap_get_group() X-Git-Tag: qemu-xen-4.16.0-rc4~675^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0216b18b79c432585b9cc49532c6223d766d552f;p=qemu-xen.git hw/vfio/ap: Plug memleak in vfio_ap_get_group() Missing g_error_free() in vfio_ap_get_group() error path. Fix that. Reported-by: Euler Robot Signed-off-by: Pan Nengyuan Reviewed-by: Pierre Morel Reviewed-by: Li Qiang Message-Id: <20200814160241.7915-3-pannengyuan@huawei.com> Signed-off-by: Cornelia Huck --- diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index b9330a8e6f..cec6fe1599 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -71,6 +71,7 @@ static VFIOGroup *vfio_ap_get_group(VFIOAPDevice *vapdev, Error **errp) if (!group_path) { error_setg(errp, "%s: no iommu_group found for %s: %s", VFIO_AP_DEVICE_TYPE, vapdev->vdev.sysfsdev, gerror->message); + g_error_free(gerror); return NULL; }