]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virhostdevtest: Don't leak @mgr->activeSCSIHostdevs
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 10 Aug 2017 07:14:36 +0000 (09:14 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 10 Aug 2017 09:22:27 +0000 (11:22 +0200)
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@redhat.com>
tests/virhostdevtest.c

index 655991c3c8488bad1877bada2faf5578f83cdcb2..0ad58ddf3d5bdad0cf4608b44f4e27c47f89e639 100644 (file)
@@ -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);
     }