[libvirt] [PATCH 1/2] conf: free the ports array of a USB hub

Andrea Bolognani abologna at redhat.com
Tue Aug 16 07:45:23 UTC 2016


On Mon, 2016-08-15 at 18:14 +0200, Ján Tomko wrote:
> The array needs to be freed too, not just its members.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1366097
> ---
>  src/conf/domain_addr.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
> index c533edb..c9cddac 100644
> --- a/src/conf/domain_addr.c
> +++ b/src/conf/domain_addr.c
> @@ -1360,6 +1360,7 @@ virDomainUSBAddressHubFree(virDomainUSBAddressHubPtr hub)
>  
>      for (i = 0; i < hub->nports; i++)
>          virDomainUSBAddressHubFree(hub->ports[i]);
> +    VIR_FREE(hub->ports);
>      virBitmapFree(hub->portmap);
>      VIR_FREE(hub);
>  }

ACK

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list