[PATCH 5/5] virhostdevtest: Don't leak @mgr->activeSCSIHostdevs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So the hostdev manager has some lists to keep track which devices
are active (=assigned to a domain) or inactive. The manager and
its lists are allocated in myInit and freed in myCleanup but one
of them (activeSCSIHostdevs) was missing. Also, the order in
which the cleanup was done doesn't make it easy to spot it,
therefore reoder it.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 tests/virhostdevtest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c
index 655991c3c..0ad58ddf3 100644
--- a/tests/virhostdevtest.c
+++ b/tests/virhostdevtest.c
@@ -73,8 +73,9 @@ myCleanup(void)
             virFileDeleteTree(mgr->stateDir);
 
         virObjectUnref(mgr->activePCIHostdevs);
-        virObjectUnref(mgr->inactivePCIHostdevs);
         virObjectUnref(mgr->activeUSBHostdevs);
+        virObjectUnref(mgr->inactivePCIHostdevs);
+        virObjectUnref(mgr->activeSCSIHostdevs);
         VIR_FREE(mgr->stateDir);
         VIR_FREE(mgr);
     }
-- 
2.13.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux