From: Michal Privoznik Date: Thu, 10 Aug 2017 07:14:36 +0000 (+0200) Subject: virhostdevtest: Don't leak @mgr->activeSCSIHostdevs X-Git-Tag: v3.7.0-rc1~176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e02b5722ed9d88b2e993eba829fc2bcc6c720aab;p=thirdparty%2Flibvirt.git virhostdevtest: Don't leak @mgr->activeSCSIHostdevs 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 --- diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index 655991c3c8..0ad58ddf3d 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); }