Blob Blame History Raw
From 9e0ace88fbe504e27928976d3b39182f9165aeaa Mon Sep 17 00:00:00 2001
Message-Id: <9e0ace88fbe504e27928976d3b39182f9165aeaa@dist-git>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Tue, 16 Aug 2016 12:49:57 +0200
Subject: [PATCH] conf: free the ports array of a USB hub
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The array needs to be freed too, not just its members.

https://bugzilla.redhat.com/show_bug.cgi?id=1366097
(cherry picked from commit d49f6853b36234ea0ec175dc39a5d67ba2a75123)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 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 6567093..7f4f4d8 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -1329,6 +1329,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);
 }
-- 
2.9.2